The tag has no wiki summary.

learn more… | top users | synonyms

20
votes
3answers
3k views

What's the standard for indentation in shell scripts?

Java community use 4 spaces as the unit of indentation. 1 Ruby community use 2 spaces that is generally agreed-upon. 2 What's the standard for indentation in shell scripts? 2 or 4 spaces or 1 tab?
8
votes
5answers
2k views

Change tab size of “cat” command

When I am in vim I can change the tab size with the following command: :set ts=4 Is it possible to set tab size for cat command output too?
6
votes
2answers
337 views

Indent the middle of multiple lines

I often run into situations like this: title : Jekyll Bootstrap tagline: Site Tagline author : name : Name Lastname email : blah@email.test github : username twitter : username feedburner : ...
5
votes
1answer
1k views

vim auto indenting even after setting noai option

I am using vim 7.2 from putty terminal. Even if I run set noai it seems vim still trying to indent code. I am copying my code from Notepad++ to vim. following is from Notepad++ and following what I ...
4
votes
2answers
209 views

Indenting multiple files

I want to indent multiple files which are poorly indented and indent them properly as would vim do when I type gg=G. Is there someway to enter the = command or its alias in the command mode? i.e ...
3
votes
1answer
682 views

Emacs cperl mode - how to use tabs for indentation instead of spaces

Is there a way to make cperl mode in emacs use all tabs for indentation instead of spaces? I've tried setting indent-tabs-mode, and cperl-tab-always-indent. Here is my .emacs file: (defalias ...
2
votes
3answers
184 views

Indent like first line

How can I indent a file such as its first line? Example: A file containing x=1+2+3+4+ 5+6+7+8 +9+10+12 should be converted to x=1+2+3+4+ 5+6+7+8 +9+10+12 I need this inside ...
2
votes
1answer
141 views

In Vim, how can I automatically determine whether to use spaces or tabs for indentation?

Sometimes I edit others source code where the prevailing style is to use tabs. In this case, I want to keep the existing convention of using literal tabs. For files I create myself, and files that ...
2
votes
1answer
38 views

Disable GNU Indent backup files

I am using GNU Indent to format C code in my project. By default backup files are created ending with a ~. I don't want to have any backup files created, is there a way to disable it?
1
vote
1answer
85 views

How do I keep 'indent' from moving curly braces to the next line?

I have several empty inline function definitions in C++ like so: class C { void foo(){} void bar(){} }; now if I run indent -st -i4 -nut test.cc in order to just fix the indentation I get ...
1
vote
1answer
230 views

Use tabs for indentation in Python mode

I am using Emacs for Python developement. My team is using Tab indentation, so I must do the same. The problem is that I can't figure out how to make python-mode use tabs instead of spaces. I want ...
1
vote
2answers
1k views

How to configure Kate to always use 2 spaces for tabulation?

By default Kate inserts 2 spaces on Tab press but switches to real tabs starting from the fourth Tab level. Can I disable this and use spaces always, regardless to the depth? I want this because I ...
1
vote
1answer
165 views

Kate replaces alignment spaces by tabs

When indenting a block of code in Kate (3.11.2), spaces used for alignment are replaced by tabs, ruining all alignments and putting me in the hell of restoring all these spaces. Example: if (true) { ...
1
vote
1answer
440 views

How to change vim auto-indent behavior?

By default vim aligns lines inside LI tags on the same position as the position of LI tag, but I want the contents of LI to have deeper indentation. Current behaviour: <LI> first line second ...
0
votes
1answer
125 views

How to indent multiple lines in nano

Selecting lines in nano can be achieved using Esc+A. With multiple lines selected, how do I then indent all those lines at once?