mirror of
https://github.com/luzifer/vim.git
synced 2024-11-09 16:10:00 +00:00
Replace autocommand breaking my files
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
7c33d30f56
commit
f6c668ea88
2 changed files with 22 additions and 31 deletions
|
@ -1,10 +0,0 @@
|
||||||
if exists('g:loaded_shfmt_wrapper')
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
let g:loaded_shfmt_wrapper = 1
|
|
||||||
|
|
||||||
function! SHFmt()
|
|
||||||
let save_pos = getpos(".")
|
|
||||||
execute "%!shfmt -s"
|
|
||||||
call setpos(".", save_pos)
|
|
||||||
endfunction
|
|
3
init.vim
3
init.vim
|
@ -32,6 +32,7 @@ Plug 'Matt-Deacalion/vim-systemd-syntax'
|
||||||
Plug 'mutewinter/nginx.vim'
|
Plug 'mutewinter/nginx.vim'
|
||||||
Plug 'posva/vim-vue'
|
Plug 'posva/vim-vue'
|
||||||
Plug 'NoahTheDuke/vim-just'
|
Plug 'NoahTheDuke/vim-just'
|
||||||
|
Plug 'z0mbix/vim-shfmt', { 'for': 'sh' }
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
|
@ -988,9 +989,9 @@ let g:LanguageClient_serverCommands = {
|
||||||
"
|
"
|
||||||
|
|
||||||
let g:formatters_vue = ['eslint_local']
|
let g:formatters_vue = ['eslint_local']
|
||||||
|
let g:shfmt_fmt_on_save = 1
|
||||||
|
|
||||||
au FileType python,javascript,vue au BufWritePre <buffer> :Autoformat
|
au FileType python,javascript,vue au BufWritePre <buffer> :Autoformat
|
||||||
au FileType sh,zsh au BufWritePre <buffer> :call SHFmt()
|
|
||||||
|
|
||||||
"
|
"
|
||||||
" typescript-vim configuration
|
" typescript-vim configuration
|
||||||
|
|
Loading…
Reference in a new issue