From 981021f18aa9ada153070b08b4fc075059999190 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 7 Aug 2018 14:23:06 +1200 Subject: Bind K in Vim help to jump to tag --- vim/after/ftplugin/help.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'vim/after') diff --git a/vim/after/ftplugin/help.vim b/vim/after/ftplugin/help.vim index e21a5259..db621315 100644 --- a/vim/after/ftplugin/help.vim +++ b/vim/after/ftplugin/help.vim @@ -9,3 +9,14 @@ if has('conceal') && &modifiable && !&readonly setlocal conceallevel=0 let b:undo_ftplugin .= '|setlocal conceallevel<' endif + +" Stop here if the user doesn't want ftplugin mappings +if exists('g:no_plugin_maps') || exists('g:no_help_maps') + finish +endif + +" Make K jump to the help topic; NeoVim does this, and it's a damned good idea +if !has('nvim') + nnoremap K + let b:undo_ftplugin .= '|nunmap K' +endif -- cgit v1.2.3 From 1c70ad8c4a026601b47ede160a7fe6d3547fa0cd Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 7 Aug 2018 14:28:50 +1200 Subject: Improve a comment on HTML URL links --- vim/after/ftplugin/html.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vim/after') diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim index 2faea4f5..dc429221 100644 --- a/vim/after/ftplugin/html.vim +++ b/vim/after/ftplugin/html.vim @@ -23,7 +23,7 @@ if exists('g:no_plugin_maps') || exists('g:no_html_maps') finish endif -" Set mappings +" Transform URLs to HTML anchors nnoremap r \ :call html#UrlLink() let b:undo_ftplugin .= '|nunmap r' -- cgit v1.2.3 From 593558497df441300342a7cb55cd7de5fbbd7485 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 7 Aug 2018 14:29:19 +1200 Subject: Bind ,K in Vim buffers as a :helpgrep shortcut --- vim/after/ftplugin/vim.vim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vim/after') diff --git a/vim/after/ftplugin/vim.vim b/vim/after/ftplugin/vim.vim index ca6b01b0..bfac623a 100644 --- a/vim/after/ftplugin/vim.vim +++ b/vim/after/ftplugin/vim.vim @@ -13,6 +13,11 @@ if exists('g:no_plugin_maps') || exists('g:no_vim_maps') finish endif +" ,K runs :helpgrep on the word under the cursor +nnoremap K + \ :helpgrep +let b:undo_ftplugin .= '|nunmap K' + " Get rid of the core ftplugin's square-bracket maps on unload let b:undo_ftplugin .= '|nunmap [[' \ . '|vunmap [[' -- cgit v1.2.3 From 27e245d9c91b584311e39728c84f2c57aa08c360 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 7 Aug 2018 15:01:24 +1200 Subject: Check surround.vim actually loaded before unmap --- vim/after/plugin/surround.vim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vim/after') diff --git a/vim/after/plugin/surround.vim b/vim/after/plugin/surround.vim index b1face5f..800bc38d 100644 --- a/vim/after/plugin/surround.vim +++ b/vim/after/plugin/surround.vim @@ -1,4 +1,7 @@ " Remove surround.vim's insert mode maps +if !exists('g:loaded_surround') + finish +endif iunmap ISurround iunmap Isurround iunmap S -- cgit v1.2.3