First things first: tabs.
" whenever I hit the tab key, it now inserts spaces instead.
set expandtab
" whenever I hit << or >>, it now indents this many spaces instead.
set shiftwidth=2
" tabstop is how many spaces a tab character looks like.
set tabstop=2
Note that if you set expandtab, and if you never open a file that already contains tab characters, you wouldn't need tabstop.
More info: http://tedlogan.com/techblog3.html
I would advise against inserting spaces into code that was written with tabs. However, I am wholeheartedly in favor of using spaces instead of tabs for projects, and do it for all of mine.
ReplyDelete