]> code.delx.au - dotfiles/blob - .vim/filetypes.vim
Greatly improved Vim's indenting settings
[dotfiles] / .vim / filetypes.vim
1 " Make vim aware of filetypes, this loads files in
2 " vimdir/{ftplugin,indent}/lang.vim
3 " where vimdir is /usr/share/vim/vimXX/ or ~/.vim/
4 " The intention is for vim to set up sensible indentation rules and other
5 " settings depending on the filetype.
6 filetype plugin indent on
7
8 " Pick up some filetypes from their extensions
9 autocmd BufNewFile,BufRead *.txt setlocal ft=text
10 autocmd BufNewFile,BufRead mutt* setlocal ft=mail
11 autocmd BufNewFile,BufRead *.tex setlocal ft=tex
12
13 " Set options based on filetypes, overriding the filetype plugin/indent options
14 autocmd FileType text setlocal wrap
15 autocmd FileType bib setlocal textwidth=78 nocindent smartindent
16 autocmd FileType mail setlocal textwidth=78
17 autocmd FileType tex setlocal wrap showbreak=>\ \ \ \ \ \ \
18 autocmd FileType objc setlocal textwidth=78 nocindent smartindent
19
20 " Don't automatically continue comments on new lines
21 """autocmd BufNewFile,BufRead * setlocal formatoptions-=r
22