From 53ce537e088b3506281f8cecebc3009b091183d7 Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Thu, 29 Oct 2020 19:13:50 -0700 Subject: [PATCH] Reset/Check Syntasitc on toggle if need --- .config/nvim/init.vim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 1c7828a..b719e01 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -234,7 +234,18 @@ let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 -nnoremap y :SyntasticToggleMode +function ToggleSyntastic() + if !exists('b:syntastic_mode') || b:syntastic_mode == 'active' + let b:syntastic_mode = 'passive' + exec 'SyntasticReset' + else + let b:syntastic_mode = 'active' + exec 'SyntasticCheck' + end + +endfunction + +nnoremap y :call ToggleSyntastic() " Tagbar let g:tagbar_type_go = {