diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2014-08-13 00:55:50 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2014-08-13 00:55:50 +0200 |
commit | 964107c604a3dc559c30febfe2a08be31659170d (patch) | |
tree | b4a8eea9167566ac207604e973fd907e5bcdb7f2 /ftdetect/polyglot.vim | |
parent | c0560d6199fe261dfd1aca6310558dc82f759fe3 (diff) | |
download | vim-polyglot-1.10.0.tar.gz vim-polyglot-1.10.0.zip |
Switch to official go package, closes #28v1.10.0
Diffstat (limited to 'ftdetect/polyglot.vim')
-rw-r--r-- | ftdetect/polyglot.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index edfca72e..59621bdd 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -38,6 +38,21 @@ autocmd BufNewFile,BufRead * \ if getline(1) =~ '^From \x\{40\} Mon Sep 17 00:00:00 2001$' | \ set filetype=gitsendemail | \ endif +let s:current_fileformats = '' +let s:current_fileencodings = '' +function! s:gofiletype_pre() + let s:current_fileformats = &g:fileformats + let s:current_fileencodings = &g:fileencodings + set fileencodings=utf-8 fileformats=unix + setlocal filetype=go +endfunction +function! s:gofiletype_post() + let &g:fileformats = s:current_fileformats + let &g:fileencodings = s:current_fileencodings +endfunction +au BufNewFile *.go setlocal filetype=go fileencoding=utf-8 fileformat=unix +au BufRead *.go call s:gofiletype_pre() +au BufReadPost *.go call s:gofiletype_post() autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml autocmd BufNewFile,BufRead *.sass setf sass autocmd BufNewFile,BufRead *.scss setf scss |