aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-08 13:39:30 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-08 13:39:30 +1300
commit02a368550446f9d2ee959905e0d633dc0f4edc98 (patch)
tree64f63d44ae28e4f29d1a6c98ba40068a76e429fb /vim
parentAdd clustering for POSIX shell syntax groups (diff)
downloaddotfiles-02a368550446f9d2ee959905e0d633dc0f4edc98.tar.gz
dotfiles-02a368550446f9d2ee959905e0d633dc0f4edc98.zip
Use consistent/thorough ftplugin/indent unloading
Unload all maps too, with silent! in case they don't exist.
Diffstat (limited to 'vim')
-rw-r--r--vim/ftplugin/html.vim6
-rw-r--r--vim/ftplugin/mail.vim2
-rw-r--r--vim/ftplugin/markdown.vim6
-rw-r--r--vim/ftplugin/perl.vim6
-rw-r--r--vim/ftplugin/sh.vim9
-rw-r--r--vim/ftplugin/text.vim6
-rw-r--r--vim/ftplugin/vim.vim4
-rw-r--r--vim/indent/csv.vim2
-rw-r--r--vim/indent/tsv.vim2
-rw-r--r--vim/indent/vim.vim10
10 files changed, 40 insertions, 13 deletions
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 <buffer> <silent>
\ <LocalLeader>r
\ :<C-U>call <SID>UrlLink()<CR>
+
+" Unload this filetype plugin
+let b:undo_user_ftplugin = ''
+ \ . '|silent! nunmap <LocalLeader>c'
+ \ . '|silent! nunmap <LocalLeader>t'
+ \ . '|silent! nunmap <LocalLeader>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 <buffer> <silent>
nnoremap <buffer> <silent>
\ <LocalLeader>t
\ :<C-U>%!perltidy<CR>
+
+" Unload this filetype plugin
+let l:undo_user_ftplugin = ''
+ \ . '|silent! unmap <LocalLeader>c'
+ \ . '|silent! unmap <LocalLeader>l'
+ \ . '|silent! unmap <LocalLeader>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 <buffer> <silent>
\ <LocalLeader>l
\ :<C-U>execute b:sh_lint<CR>
-" 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 <LocalLeader>c'
+ \ . '|silent! unmap <LocalLeader>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 <buffer> <silent>
\ <LocalLeader>l
\ :<C-U>write !vint -s /dev/stdin<CR>
+
+" Unload this filetype plugin
+let b:undo_user_ftplugin
+ \ = 'silent! nunmap <LocalLeader>l'
diff --git a/vim/indent/csv.vim b/vim/indent/csv.vim
index 682bc3a8..ae2b6f6c 100644
--- a/vim/indent/csv.vim
+++ b/vim/indent/csv.vim
@@ -1,5 +1,7 @@
" Manual indenting and literal tabs for CSVs
setlocal noautoindent
setlocal noexpandtab
+
+" Unload this indent plugin
let b:undo_user_indent
\ = 'setlocal autoindent< expandtab<'
diff --git a/vim/indent/tsv.vim b/vim/indent/tsv.vim
index 951b3e60..759602ed 100644
--- a/vim/indent/tsv.vim
+++ b/vim/indent/tsv.vim
@@ -1,5 +1,7 @@
" Manual indenting and literal tabs for TSVs
setlocal noautoindent
setlocal noexpandtab
+
+" Unload this indent plugin
let b:undo_user_indent
\ = 'setlocal autoindent< expandtab<'
diff --git a/vim/indent/vim.vim b/vim/indent/vim.vim
index 047a353d..138b9205 100644
--- a/vim/indent/vim.vim
+++ b/vim/indent/vim.vim
@@ -3,9 +3,7 @@ setlocal shiftwidth=2
setlocal softtabstop=2
setlocal tabstop=2
-" Ancient Vim can't use the '<' suffix syntax for resetting local integer
-" options
-if v:version > 700
- let b:undo_user_indent
- \ = 'setlocal shiftwidth< softtabstop< tabstop<'
-endif
+" Unload this indent plugin; suppress errors because ancient Vim can't use the
+" '<' suffix syntax for resetting local integer
+let b:undo_user_indent
+ \ = 'silent! setlocal shiftwidth< softtabstop< tabstop<'