set expandtab beware those who would persecute for the defiling of the tabstops ;)
In seriousness, there are places for spaces, but tabs allow those reading your code to customize their view to how they prefer their tabs (some like 2, I like 4, some like 8, or maybe 7). Spaces are harder to customize rapidly, but will preserve formatting (i.e. of comments) far better. On Tue, Jan 19, 2010 at 3:31 PM, Jeremy Leonard <[email protected]> wrote: > Is there a way to make the tab key in vi (vim) use spaces instead of > the tab? > > On Jan 11, 9:57 am, [email protected] wrote: > > put this in your ~/.vimrc: > > set ts=4 > > set sw=4 > > > > ts is the tabstop, and will make the tab character render as 4 spaces. > > sw is the shiftwidth, and will affect vim's indenting (using the >>/<< > > commands or the autoindent feature), and make default indentation > > changes be 4 spaces (or one tabstop). > > > > On Mon, Jan 11, 2010 at 06:42:05AM -0800, Jeremy Leonard wrote: > > > I'm trying to figure out how to change the number of characters that > > > bash and vi uses when displaying tabs in a file. It seems like the > > > default is 8 and I would like to change this to 4. I think I'm either > > > looking in the wrong places or I'm blind ... any help would be greatly > > > appreciated. Thanks. > > > -- > > > You received this message because you are subscribed to the Linux Users > Group. > > > To post a message, send email to [email protected] > > > To unsubscribe, send email to > [email protected] > > > For more options, visit our group athttp:// > groups.google.com/group/linuxusersgroup > > > > > > -- > You received this message because you are subscribed to the Linux Users > Group. > To post a message, send email to [email protected] > To unsubscribe, send email to [email protected] > For more options, visit our group at > http://groups.google.com/group/linuxusersgroup > -- Daniel
-- You received this message because you are subscribed to the Linux Users Group. To post a message, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit our group at http://groups.google.com/group/linuxusersgroup
