aboutsummaryrefslogtreecommitdiff
path: root/vim/after
diff options
context:
space:
mode:
Diffstat (limited to 'vim/after')
-rw-r--r--vim/after/ftplugin/help.vim11
-rw-r--r--vim/after/ftplugin/html.vim2
-rw-r--r--vim/after/ftplugin/vim.vim5
-rw-r--r--vim/after/plugin/surround.vim3
4 files changed, 20 insertions, 1 deletions
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 <buffer> K <C-]>
+ let b:undo_ftplugin .= '|nunmap <buffer> K'
+endif
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 <buffer> <LocalLeader>r
\ :<C-U>call html#UrlLink()<CR>
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>r'
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 <buffer> <LocalLeader>K
+ \ :<C-U>helpgrep <cword><CR>
+let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>K'
+
" Get rid of the core ftplugin's square-bracket maps on unload
let b:undo_ftplugin .= '|nunmap <buffer> [['
\ . '|vunmap <buffer> [['
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 <Plug>ISurround
iunmap <Plug>Isurround
iunmap <C-G>S