2016-12-26 08:36:23 +00:00
|
|
|
" define a group `init` and initialize.
|
|
|
|
augroup init
|
2015-05-05 11:18:25 +00:00
|
|
|
autocmd!
|
|
|
|
|
|
|
|
" Remember last location/cursor in file
|
|
|
|
autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif
|
|
|
|
|
2017-03-10 13:21:30 +00:00
|
|
|
" spell correction on markdown files and mail (for mutt)
|
|
|
|
autocmd FileType mail,markdown setlocal spell
|
|
|
|
autocmd FileType mail,markdown setlocal wrap
|
|
|
|
autocmd FileType mail,markdown setlocal spelllang=en,de
|
|
|
|
|
|
|
|
" special settings for writing emails, flowed text at 72 width
|
|
|
|
autocmd FileType mail setlocal textwidth=72
|
|
|
|
autocmd FileType mail setlocal comments+=nb:>
|
|
|
|
autocmd FileType mail setlocal formatoptions+=awq
|
2015-05-05 11:18:25 +00:00
|
|
|
|
|
|
|
" add the dash to keywords -- makes better css/js/html search
|
2016-12-26 08:36:23 +00:00
|
|
|
" do this for specific files only (not in php/rb e.g.) where dashes are
|
|
|
|
" not used in variable names (use camelCase instead here)
|
|
|
|
autocmd BufNewFile,BufRead *.{js,css,scss,html} set iskeyword+=-
|
|
|
|
autocmd BufNewFile,BufRead *.{js,css,scss,html} set iskeyword-=_
|
2015-05-05 11:18:25 +00:00
|
|
|
autocmd BufNewFile,BufRead *.php set iskeyword-=-
|
|
|
|
|
|
|
|
" omnicompletion for some filetypes
|
|
|
|
autocmd FileType css,scss setlocal omnifunc=csscomplete#CompleteCSS
|
|
|
|
autocmd FileType html,php,twig setlocal omnifunc=htmlcomplete#CompleteTags
|
|
|
|
autocmd FileType php setlocal omnifunc=phpcomplete#CompletePHP
|
|
|
|
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
|
|
|
|
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
|
|
|
|
augroup END
|