]> code.delx.au - dotfiles/blobdiff - .vim/filetypes.vim
screenrc rewrite
[dotfiles] / .vim / filetypes.vim
index 1e7200db858e8949702de451b3d4b143e1677f9a..fbdd84a0e691640f84a29367e4274e4f79609062 100644 (file)
@@ -1,13 +1,38 @@
-" Make vim aware of filetypes
-filetype plugin on
+" 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
-autocmd FileType text setlocal textwidth=78 nosmartindent
-autocmd FileType mail setlocal textwidth=78 nosmartindent
-autocmd FileType tex setlocal textwidth=78 nosmartindent
+" 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