diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-06-25 13:53:32 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-06-25 13:53:32 +1200 |
commit | 5f73fa74a27145830177d4c9e24223efd70c222c (patch) | |
tree | 99472dc35e4d7a329ba36a76b61fdbeff7009b93 /vim/vimrc | |
parent | Upgrade fixed_join.vim, define map explicitly (diff) | |
download | dotfiles-5f73fa74a27145830177d4c9e24223efd70c222c.tar.gz dotfiles-5f73fa74a27145830177d4c9e24223efd70c222c.zip |
Clear local leader maps on filetype change
Iterate through all the buffer-local mappings each time the filetype
changes, and clear any that begin with the local leader, using two
autoloaded functions and one autoload variable for :redir.
I really don't think it should be this hard. I hope I haven't missed
something in the documentation that makes this easier. I thought
maparg() or mapcheck() might do it, but no such luck.
Maybe I can refactor this later.
Diffstat (limited to 'vim/vimrc')
-rw-r--r-- | vim/vimrc | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -280,6 +280,9 @@ if has('autocmd') && v:version >= 700 augroup vimrc_filetype_mappings autocmd! + " Clear existing local leader maps + autocmd FileType * call vimrc#ClearLocalLeaderMaps() + " Diff: prune sections autocmd FileType diff nmap <buffer> _p <Plug>DiffPrune autocmd FileType diff xmap <buffer> _p <Plug>DiffPrune |