Commits

johannes committed cb15d5a

Use 'setlocal ft' instead of 'setf' for all filetypes. Got bitten by it for the last time. Also a bit of restructuring

Comments (0)

Files changed (1)

 set scrolloff=3       " Try to keep three lines visible on top/bottom when scrolling
 set vb t_vb=          " No bell
 
-autocmd! FileType python                           " Remove all python autocmds
-autocmd FileType python set suffixesadd+=.py       " Make 'gf' work on python import statements
+autocmd! FileType python                                     " Remove all python autocmds
+autocmd FileType python set suffixesadd+=.py                 " Make 'gf' work on python import statements
 autocmd FileType python set omnifunc=pythoncomplete#Complete " Omnicomplete with CTRL+x CTRL+o
-autocmd! BufWritePost vimrc.vim source %           " Reload vimrc on save
-autocmd! BufNewFile,BufRead *.pde   setf arduino   " To get syntax highlighting for Arduino projects
-autocmd! BufNewFile,BufRead *.ot    setf selftest  " To get syntax highlighting for Opera selftests
-autocmd! BufNewFile,BufRead *.mkd   setf mkd       " To get syntax highlighting for markdown
-autocmd! BufNewFile,BufRead *.rs    setlocal ft=rust " 'setlocal ft' instead of 'setf' 
-                                                     " to override default, see :help setf
-autocmd! BufRead,BufNewFile *.json  setf json
-autocmd! BufNewFile,BufRead *.frag,*.vert,*.fp,*.vp,*.glsl setlocal ft=glsl
-autocmd! BufRead,BufNewFile *       call Detect_space_or_tab()
+autocmd! BufWritePost vimrc.vim source %                     " Reload vimrc on save
+" To get syntax highlighting for different filetypes:
+" Using 'setlocal ft' instead of 'setf' to override default, see :help setf
+autocmd! BufNewFile,BufRead *.pde            setlocal ft=arduino
+autocmd! BufNewFile,BufRead *.ot             setlocal ft=selftest
+autocmd! BufNewFile,BufRead *.mkd            setlocal ft=mkd
+autocmd! BufNewFile,BufRead *.rs             setlocal ft=rust
+autocmd! BufNewFile,BufRead *.json           setlocal ft=json
+autocmd! BufNewFile,BufRead *.frag,*.vert    setlocal ft=glsl
+autocmd! BufNewFile,BufRead *.fp,*.vp,*.glsl setlocal ft=glsl
+
+autocmd! BufNewFile,BufRead *                call Detect_space_or_tab()
 
 " Hack to get the path where this file is stored.
 " If you are reading this and know a better way, let me know!