indentation

VS2008 Removes my Indentation in .js file

I'm working with ExtJs framework and so have to code a lot of JS in vs2008, however, VS2008 keeps removing my indentation and its driving me nuts. How do I remove the "auto-indent" feature? Thanks ...

Why does Visual Studio use different indentation settings for C# and for C++?

For C# Visual Studio uses 4 spaces by default, whereas for C++ it is hard-tabs. Why is it so? Why is it different? My project consists of both C# and C++ code and the difference really annoys me. I want to set a common standard for all the sources, but I wonder if this would have any drawbacks. ...

Visual Studio 2005 : Is there an easy way to indent correctly in an ASPX file?

In Visual Studio 2005, is there a way to indent correctly the tags in the aspx file (not in .cs files but really in ASPX files which contain HTML/ASP code)? ...

Text Wrapping in Gedit

Is is possible in Gedit (The GNOME text editor) to indent a wrapped line of text? For Example: if (x > y) { System.out.println("ABCDEFGHIJ KLMNOPQRSTUVWXYZ"); } instead of: if (x > y) { System.out.println("ABCDEFGHIJ KLMNOPQRSTUVWXYZ"); } ...

emacs c++-mode incorrect indentation?

Hi, I'm running emacs 23 with c++-mode and having some indentation problems. Suppose I have this code: void foo() { if (cond) { <--- int i; ... } <--- } This seems to be the default behavior of the automatic indentation. However I'd like to change it so it'll be like this: void foo() { if (cond) { ...

emacs javascript auto indentation

I'm looking for a way to turn off automatic indentation in emacs. I don't want emacs to automatically indent code when I enter special characters like ; or /* Thanks for any help. ...

If you break long code lines, how do you indent the stuff on the next line?

Sometimes you have to write in your source long lines, that are better to break. How do you indent the stuff ceated by this. You can indent it the same: very long statement; other statement; That makes it harder to differentiate from the following code, as shown in the example. On the other hand you could indent it one level: very l...

indentation of multiline string

I have a script that uses the cmd Python module. The cmd module uses a triple quoted multiline string as it's help text. Something like this def x(self, strags = None): """class help text here and some more help text here""" When running the script, the command 'help x' will print the string. It will, however, print the ne...

using tab or spaces (indentation for code)

Duplicate of Are spaces preferred over tabs for indentation and almost certainly others For a long time the coding rules and guidelines in my company recommended usage of tabs (of size 4) over spaces (to save valuable storage space), initially I found it tough when I started working for my company, in the long run I got used to it. Now ...

Emacs indentation of the for each statement in C++

I'm trying to get emacs to correctly format the "for each" construct in c++. I want the braces to be lined up with the f in for in both of the following examples: for each(Type a in b) { //^c^s shows substatement-open //... do stuff } for( ; ; ) { //^c^s shows substatement-open //... do stuff } In b...

Indentation with DOMDocument in PHP

I'm using DOMDocument to generate a new XML file and I would like for the output of the file to be indented nicely so that it's easy to follow for a human reader. For example, when DOMDocument outputs this data: <?xml version="1.0"?> <this attr="that"><foo>lkjalksjdlakjdlkasd</foo><foo>lkjlkasjlkajklajslk</foo></this> I want the XML ...

How to indent F# code in Visual Studio 2008 in #light mode.

Is pressing spacebar only way to indent for F# in #light mode? This seems like a serious hindrance while using #light mode. Is there a better way than keep on pressing space bar in VS 2008? [Answer] by Brian (answer) 1. Go to Tools -> Options -> Text Editor -> F# -> Tabs 2. Select Insert Spaces ...

Indenting #defines

Hi all, I know that #defines etc. are normally never indented. Why? I'm working in some code at the moment which has a horrible mixture of #defines, #ifdefs, #elses, #endifs, #etc. All these often mixed in with normal C code. The non-indenting of the #defines makes them hard to read. And the mixture of indented code with non-indented...

Algorithm for neatly indenting SQL statements (Python implementation would be nice)

I'd like to reformat some SQL statements that are a single string with newlines in to something that's much easier to read. I don't personally know of a good coding style for indenting SQL - how should nested queries / where clauses / left joins / etc by represented to maximise readability? Has anyone seen a pretty-printing algorithm t...

How do I tidy up an HTML file's indentation in VI?

The other day my friend asked me how to fix the indentation of his huge html files which was all messed up. I tried the usual "gg=G" command, which is what I use to fix the indentation of code files. However, it didn't seem to work right on HTML files. It simply removed all the formatting. I also tried setting :filetype = xml, to see...

How can I wrap text to some length in Vim?

Let's speak of relative measures. My Vim looks like: aaaaaaaaaaaaa bbbbbbbbbbbbb ccccccccccccc etc I would like it to be smaller: aaaaa aaaaa bbbbb bbbbb ccccc ccccc etc How can I get it? And how can I manage setting the length of such a block? ...

Indentation in python GUI

As i write code in python and suddenly feel like adding a new block in front of the code i have already written.... the indentation of the complete code is affected.. it is very tedious process to move to each line and change the indentation...is there any way to do auto indent or something... eg: def somefunction: x =5 retur...

How can I spot subtle Lisp syntax mistakes?

I'm a newbie playing around with Lisp (actually, Emacs Lisp). It's a lot of fun, except when I seem to run into the same syntax mistakes again and again. For instance, here's something I've encountered several times. I have some cond form, like (cond ((foo bar) (qux quux)) ((or corge (grault warg)) (fred) (t xyzzy))) ...

Emacs indentation of break after switch statement

Right now the standard emacs indentation works like the following: switch (cond) { case 0: { command; } break; } I want the break; to line up with case. Also, is there a list of the c-set-offset commands somewhere? ...

Multiplying strings in C#

Possible Duplicate: Can I "multiply" a string (in C#)? Exact duplicate of Can I “multiply” a string (in C#)? In Python I can do this: >>> i = 3 >>> 'hello' * i 'hellohellohello' How can I multiply strings in C# similarly to in Python? I could easily do it in a for loop but that gets tedious and non-expressive. Ultimately I...