|
let s:current_fileformats = ''
let s:current_fileencodings = ''
function! s:vsfiletype_pre()
let s:current_fileformats = &g:fileformats
let s:current_fileencodings = &g:fileencodings
set fileencodings=utf-8 fileformats=unix
setlocal filetype=vs
endfunction
function! s:vsfiletype_post()
let &g:fileformats = s:current_fileformats
let &g:fileencodings = s:current_fileencodings
endfunction
au BufNewFile *.cs,*.csproj,*.vb,*.vbproj,*.sln,*.aspx setlocal filetype=vs fileencoding=utf-8 fileformat=unix
au BufRead *.cs,*.csproj,*.vb,*.vbproj,*.sln,*.aspx call s:vsfiletype_pre()
au BufReadPost *.cs,*.csproj,*.vb,*.vbproj,*.sln,*.aspx call s:vsfiletype_post()
|