diff options
Diffstat (limited to 'ftdetect')
-rw-r--r-- | ftdetect/polyglot.vim | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 4d34aa1a..6bf83344 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -280,6 +280,8 @@ augroup END augroup filetypedetect " go:fatih/vim-go:_BASIC +" vint: -ProhibitAutocmdWithNoGroup + " We take care to preserve the user's fileencodings and fileformats, " because those settings are global (not buffer local), yet we want " to override them for loading Go files, which are defined to be UTF-8. @@ -300,18 +302,16 @@ function! s:gofiletype_post() let &g:fileencodings = s:current_fileencodings endfunction -augroup vim-go-filetype - autocmd! - au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix - au BufRead *.go call s:gofiletype_pre("go") - au BufReadPost *.go call s:gofiletype_post() +" Note: should not use augroup in ftdetect (see :help ftdetect) +au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix +au BufRead *.go call s:gofiletype_pre("go") +au BufReadPost *.go call s:gofiletype_post() - au BufNewFile *.s setfiletype asm | setlocal fileencoding=utf-8 fileformat=unix - au BufRead *.s call s:gofiletype_pre("asm") - au BufReadPost *.s call s:gofiletype_post() +au BufNewFile *.s setfiletype asm | setlocal fileencoding=utf-8 fileformat=unix +au BufRead *.s call s:gofiletype_pre("asm") +au BufReadPost *.s call s:gofiletype_post() - au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl -augroup end +au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl " vim: sw=2 ts=2 et augroup END |