1
0
mirror of https://github.com/amix/vimrc synced 2025-07-03 22:25:32 +08:00

updated plugins and added eslint goodies

This commit is contained in:
Max Alcala
2016-02-19 10:35:36 -06:00
parent a1deb28314
commit f3143286d3
402 changed files with 14389 additions and 4024 deletions

View File

@ -5,11 +5,11 @@ let s:current_fileformats = ''
let s:current_fileencodings = ''
" define fileencodings to open as utf-8 encoding even if it's ascii.
function! s:gofiletype_pre()
function! s:gofiletype_pre(type)
let s:current_fileformats = &g:fileformats
let s:current_fileencodings = &g:fileencodings
set fileencodings=utf-8 fileformats=unix
setlocal filetype=go
let &l:filetype = a:type
endfunction
" restore fileencodings as others
@ -18,10 +18,14 @@ function! s:gofiletype_post()
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 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 BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
" vim:ts=4:sw=4:et