]> code.delx.au - dotfiles/blob - .vim/filetypes.vim
autostart: xmonad session hacks
[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 autocmd BufNewFile,BufRead CMakeLists.txt setlocal ft=cmake
13 autocmd BufNewFile,BufRead buildfile setlocal ft=ruby
14 autocmd BufNewFile,BufRead build.gradle setlocal ft=groovy
15
16 " Set options based on filetypes, overriding the filetype plugin/indent options
17 autocmd FileType text call WrapOn()
18 autocmd FileType markdown call WrapOn()
19 autocmd FileType bib setlocal textwidth=78 nocindent smartindent
20 autocmd FileType mail setlocal textwidth=0
21 autocmd FileType mail call WrapOn()
22 autocmd FileType tex call WrapOn()
23 autocmd FileType objc setlocal nocindent smartindent
24 autocmd FileType cmake setlocal nowrap
25 autocmd FileType vim setlocal formatoptions-=r
26
27 " Don't allow syntax/sh.vim to change my iskeyword setting
28 let g:sh_noisk=1
29
30 " Who uses octal anyway?
31 set nrformats-=octal
32
33 " Don't automatically continue comments on new lines
34 """autocmd BufNewFile,BufRead * setlocal formatoptions-=r
35
36 " Use space for indendation in some files
37 " autocmd BufNewFile,BufRead /path/to/someproject setlocal expandtab tabstop=8 softtabstop=4 shiftwidth=4
38