From 02a368550446f9d2ee959905e0d633dc0f4edc98 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 8 Nov 2017 13:39:30 +1300 Subject: Use consistent/thorough ftplugin/indent unloading Unload all maps too, with silent! in case they don't exist. --- vim/ftplugin/html.vim | 6 ++++++ vim/ftplugin/mail.vim | 2 ++ vim/ftplugin/markdown.vim | 6 ++++-- vim/ftplugin/perl.vim | 6 ++++++ vim/ftplugin/sh.vim | 9 ++++++--- vim/ftplugin/text.vim | 6 ++++-- vim/ftplugin/vim.vim | 4 ++++ 7 files changed, 32 insertions(+), 7 deletions(-) (limited to 'vim/ftplugin') diff --git a/vim/ftplugin/html.vim b/vim/ftplugin/html.vim index 3db5dcca..27b38424 100644 --- a/vim/ftplugin/html.vim +++ b/vim/ftplugin/html.vim @@ -28,3 +28,9 @@ endfunction nnoremap \ r \ :call UrlLink() + +" Unload this filetype plugin +let b:undo_user_ftplugin = '' + \ . '|silent! nunmap c' + \ . '|silent! nunmap t' + \ . '|silent! nunmap r' diff --git a/vim/ftplugin/mail.vim b/vim/ftplugin/mail.vim index d4840bfd..697ce499 100644 --- a/vim/ftplugin/mail.vim +++ b/vim/ftplugin/mail.vim @@ -1,4 +1,6 @@ " Use trailing whitespace to denote continued paragraph setlocal formatoptions+=w + +" Unload this filetype plugin let b:undo_user_ftplugin \ = 'setlocal formatoptions<' diff --git a/vim/ftplugin/markdown.vim b/vim/ftplugin/markdown.vim index ab27c2f7..f26fb156 100644 --- a/vim/ftplugin/markdown.vim +++ b/vim/ftplugin/markdown.vim @@ -1,6 +1,8 @@ " Spellcheck documents by default if has('syntax') setlocal spell - let b:undo_user_ftplugin - \ = 'setlocal spell<' endif + +" Unload this filetype plugin +let b:undo_user_ftplugin + \ = 'silent! setlocal spell<' diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim index 07cf9a1f..7f6eb7fe 100644 --- a/vim/ftplugin/perl.vim +++ b/vim/ftplugin/perl.vim @@ -12,3 +12,9 @@ nnoremap nnoremap \ t \ :%!perltidy + +" Unload this filetype plugin +let l:undo_user_ftplugin = '' + \ . '|silent! unmap c' + \ . '|silent! unmap l' + \ . '|silent! unmap t' diff --git a/vim/ftplugin/sh.vim b/vim/ftplugin/sh.vim index 179ea56e..a8c94445 100644 --- a/vim/ftplugin/sh.vim +++ b/vim/ftplugin/sh.vim @@ -45,6 +45,9 @@ nnoremap \ l \ :execute b:sh_lint -" Clear away these extra changes -let b:undo_user_ftplugin - \ = 'setlocal keywordprg< | unlet! b:sh_check b:sh_lint' +" Unload this filetype plugin +let b:undo_user_ftplugin = '' + \ . '|setlocal keywordprg<' + \ . '|unlet! b:sh_check b:sh_lint' + \ . '|silent! unmap c' + \ . '|silent! unmap l' diff --git a/vim/ftplugin/text.vim b/vim/ftplugin/text.vim index ab27c2f7..f26fb156 100644 --- a/vim/ftplugin/text.vim +++ b/vim/ftplugin/text.vim @@ -1,6 +1,8 @@ " Spellcheck documents by default if has('syntax') setlocal spell - let b:undo_user_ftplugin - \ = 'setlocal spell<' endif + +" Unload this filetype plugin +let b:undo_user_ftplugin + \ = 'silent! setlocal spell<' diff --git a/vim/ftplugin/vim.vim b/vim/ftplugin/vim.vim index d4e55ace..e8113134 100644 --- a/vim/ftplugin/vim.vim +++ b/vim/ftplugin/vim.vim @@ -4,3 +4,7 @@ nnoremap \ l \ :write !vint -s /dev/stdin + +" Unload this filetype plugin +let b:undo_user_ftplugin + \ = 'silent! nunmap l' -- cgit v1.2.3