diff options
Diffstat (limited to 'vim/.vimrc')
| -rw-r--r-- | vim/.vimrc | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -85,6 +85,7 @@ call which_key#register('<Space>', 'g:which_key_map') autocmd User LspSetup call LspOptionsSet(#{ \ autoComplete: v:true, \ autoHighlightDiags: v:true, + \ formatFallbck: v:true, \ }) autocmd User LspSetup call LspAddServer([ @@ -109,10 +110,7 @@ function! s:lsp_keymaps() abort nmap <buffer> [g :LspDiagPrev<CR> nmap <buffer> ]g :LspDiagNext<CR> nmap <buffer> K :LspHover<CR> -if index(['python', 'c', 'cpp', 'objc', 'objcpp', - \ 'javascript', 'javascript.jsx', 'javascriptreact'], &filetype) >= 0 - autocmd BufWritePre <buffer> LspFormat -endif +autocmd BufWritePre <buffer> LspFormat endfunction function! s:prettier_format() abort if !executable('prettier') @@ -123,6 +121,8 @@ function! s:prettier_format() abort if v:shell_error silent undo echohl ErrorMsg | echom 'formatting failed' + else + silent! 1s/<!doctype html>/<!DOCTYPE html>/e endif call winrestview(l:view) endfunction |
