From 1ccd99e113324602b4eca41fd24ba6f991e8f05d Mon Sep 17 00:00:00 2001 From: "D. Ben Knoble" Date: Sun, 19 Nov 2023 04:13:56 -0500 Subject: [PATCH] add b:undo_ftplugin (#4625) --- ftplugin/ale-fix-suggest.vim | 3 +++ ftplugin/ale-info.vim | 6 ++++++ ftplugin/ale-preview-selection.vim | 15 +++++++++++++++ ftplugin/ale-preview.vim | 3 +++ 4 files changed, 27 insertions(+) diff --git a/ftplugin/ale-fix-suggest.vim b/ftplugin/ale-fix-suggest.vim index 189a4dc2..42ade0fd 100644 --- a/ftplugin/ale-fix-suggest.vim +++ b/ftplugin/ale-fix-suggest.vim @@ -1,2 +1,5 @@ " Close the ALEFixSuggest window with the q key. noremap q :q! + +let b:undo_ftplugin = get(b:, 'undo_ftplugin', 'execute') +let b:undo_ftplugin .= ' | execute "silent! unmap q"' diff --git a/ftplugin/ale-info.vim b/ftplugin/ale-info.vim index 65913a76..c2c794b2 100644 --- a/ftplugin/ale-info.vim +++ b/ftplugin/ale-info.vim @@ -14,3 +14,9 @@ endfunction " Press space to open :help for an ALE Variable nnoremap :call ALEInfoOpenHelp() + +let b:undo_ftplugin = get(b:, 'undo_ftplugin', 'execute') +let b:undo_ftplugin .= ' | setlocal synmaxcol<' +let b:undo_ftplugin .= ' | execute "silent! unmap q"' +let b:undo_ftplugin .= ' | execute "silent! nunmap "' +let b:undo_ftplugin .= ' | delfunction! ALEInfoOpenHelp' diff --git a/ftplugin/ale-preview-selection.vim b/ftplugin/ale-preview-selection.vim index 7ec84068..1ddd0abf 100644 --- a/ftplugin/ale-preview-selection.vim +++ b/ftplugin/ale-preview-selection.vim @@ -14,3 +14,18 @@ noremap O " Keybinds for opening selection items. noremap :call ale#preview#OpenSelection() noremap t :call ale#preview#OpenSelectionInTab() + +let b:undo_ftplugin = get(b:, 'undo_ftplugin', 'execute') +let b:undo_ftplugin .= ' | execute "silent! unmap q"' +let b:undo_ftplugin .= ' | execute "silent! unmap v"' +let b:undo_ftplugin .= ' | execute "silent! unmap i"' +let b:undo_ftplugin .= ' | execute "silent! unmap I"' +let b:undo_ftplugin .= ' | execute "silent! unmap "' +let b:undo_ftplugin .= ' | execute "silent! unmap "' +let b:undo_ftplugin .= ' | execute "silent! unmap "' +let b:undo_ftplugin .= ' | execute "silent! unmap a"' +let b:undo_ftplugin .= ' | execute "silent! unmap A"' +let b:undo_ftplugin .= ' | execute "silent! unmap o"' +let b:undo_ftplugin .= ' | execute "silent! unmap O"' +let b:undo_ftplugin .= ' | execute "silent! unmap "' +let b:undo_ftplugin .= ' | execute "silent! unmap t"' diff --git a/ftplugin/ale-preview.vim b/ftplugin/ale-preview.vim index ffbffbd5..75f3bb50 100644 --- a/ftplugin/ale-preview.vim +++ b/ftplugin/ale-preview.vim @@ -1,2 +1,5 @@ " Close the ALEPreviewWindow window with the q key. noremap q :q! + +let b:undo_ftplugin = get(b:, 'undo_ftplugin', 'execute') +let b:undo_ftplugin .= ' | execute "silent! unmap q"'