1
0
mirror of https://github.com/luzifer/vim.git synced 2024-09-19 11:02:55 +00:00

Replace autocommand breaking my files

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2022-10-22 22:40:27 +02:00
parent 7c33d30f56
commit f6c668ea88
Signed by: luzifer
GPG Key ID: D91C3E91E4CAD6F5
2 changed files with 22 additions and 31 deletions

View File

@ -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

View File

@ -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