" Make vim aware of filetypes, this loads files in " vimdir/{ftplugin,indent}/lang.vim " where vimdir is /usr/share/vim/vimXX/ or ~/.vim/ " The intention is for vim to set up sensible indentation rules and other " settings depending on the filetype. filetype plugin indent on " Pick up some filetypes from their extensions autocmd BufNewFile,BufRead *.txt setlocal ft=text autocmd BufNewFile,BufRead mutt* setlocal ft=mail autocmd BufNewFile,BufRead *.tex setlocal ft=tex autocmd BufNewFile,BufRead CMakeLists.txt setlocal ft=cmake autocmd BufNewFile,BufRead buildfile setlocal ft=ruby autocmd BufNewFile,BufRead build.gradle setlocal ft=groovy " Set options based on filetypes, overriding the filetype plugin/indent options autocmd FileType text call WrapOn() autocmd FileType markdown call WrapOn() autocmd FileType bib setlocal textwidth=78 nocindent smartindent autocmd FileType mail setlocal textwidth=0 autocmd FileType mail call WrapOn() autocmd FileType tex call WrapOn() autocmd FileType objc setlocal nocindent smartindent autocmd FileType cmake setlocal nowrap autocmd FileType vim setlocal formatoptions-=r " Don't allow syntax/sh.vim to change my iskeyword setting let g:sh_noisk=1 " Who uses octal anyway? set nrformats-=octal " Don't automatically continue comments on new lines """autocmd BufNewFile,BufRead * setlocal formatoptions-=r " Use space for indendation in some files " autocmd BufNewFile,BufRead /path/to/someproject setlocal expandtab tabstop=8 softtabstop=4 shiftwidth=4