星期二, 9月 07, 2010

To turn off expandtab for editing Makefile

cut from vim wikia
http://vim.wikia.com/wiki/Converting_tabs_to_spaces

to get the following coding style,

  • No tabs in the source file.
  • All tab characters are 4 space characters.
use the following set of options:

:set tabstop=4
:set shiftwidth=4
:set expandtab

BUT

To turn off expandtab for editing makefiles, put the following in your vimrc:

autocmd FileType make setlocal noexpandtab

沒有留言: