I have the following settings on Unix:
au BufNewFile,BufRead *.py
\ set tabstop=4
\ set softtabstop=4
\ set shiftwidth=4
\ set textwidth=79
\ set expandtab
\ set autoindent
\ set fileformat=unix
au BufNewFile,BufRead *.js, *.html, *.css
\ set tabstop=2
\ set softtabstop=2
\ set shiftwidth=2
But I didn't manage to use it on Windows 7. Could anyone please tell me how to make it work?
The settings must be modified before you migrate it from Unix to Windows as follows:
au BufNewFile,BufRead *.py
\ set tabstop=4
\ softtabstop=4
\ shiftwidth=4
\ textwidth=79
\ expandtab
\ autoindent
\ fileformat=unix
au BufNewFile,BufRead *.html
\ set tabstop=2
\ softtabstop=2
\ shiftwidth=2
au BufNewFile,BufRead *.css
\ set tabstop=2
\ softtabstop=2
\ shiftwidth=2
au BufNewFile,BufRead *.js
\ set tabstop=2
\ softtabstop=2
\ shiftwidth=2
Next, save it to $VIMRUNTIME/XXX.vim
(where XXX
is a placeholder), and then source it in your _vimrc
file.