aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-25 08:32:34 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-25 08:32:34 +1200
commit7dbaec51d9b6d122c059a08df198abfe95003b71 (patch)
tree33a2c2409d438e8918c45cd94727f7fd095036ff
parentUse more explicit/readable mode test (diff)
downloadvim-diff-prune-7dbaec51d9b6d122c059a08df198abfe95003b71.tar.gz
vim-diff-prune-7dbaec51d9b6d122c059a08df198abfe95003b71.zip
Remove default mappingsv0.2.0
-rw-r--r--README.md2
-rw-r--r--after/ftplugin/diff/prune.vim14
-rw-r--r--doc/diff_prune.txt15
3 files changed, 9 insertions, 22 deletions
diff --git a/README.md b/README.md
index c8bafe3..8761d5c 100644
--- a/README.md
+++ b/README.md
@@ -9,8 +9,6 @@ lines with leading plus signs are deleted.
This can be handy for using with the `-e` or `--edit` option to `git-add`,
which allows you to edit a diff before applying changes to the staging area.
-The default binding is `<LocalLeader>p`.
-
License
-------
diff --git a/after/ftplugin/diff/prune.vim b/after/ftplugin/diff/prune.vim
index 9996023..00f42bd 100644
--- a/after/ftplugin/diff/prune.vim
+++ b/after/ftplugin/diff/prune.vim
@@ -27,23 +27,9 @@ nnoremap <buffer> <silent>
let b:undo_ftplugin = b:undo_ftplugin
\ . '|nunmap <buffer> <Plug>DiffPrune'
-" Default local normal mapping if not already defined
-if !hasmapto('<Plug>DiffPrune', 'n')
- nmap <buffer> <LocalLeader>p <Plug>DiffPrune
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>p'
-endif
-
" Define visual mode mapping target
vnoremap <buffer> <silent>
\ <Plug>DiffPrune
\ :<C-U>call diff#prune#Prune(visualmode())<CR>
let b:undo_ftplugin = b:undo_ftplugin
\ . '|vunmap <buffer> <Plug>DiffPrune'
-
-" Default local visual mapping if not already defined
-if !hasmapto('<Plug>DiffPrune', 'v')
- vmap <buffer> <LocalLeader>p <Plug>DiffPrune
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|vunmap <buffer> <LocalLeader>p'
-endif
diff --git a/doc/diff_prune.txt b/doc/diff_prune.txt
index 88ace86..3e10699 100644
--- a/doc/diff_prune.txt
+++ b/doc/diff_prune.txt
@@ -18,12 +18,15 @@ or newer.
MAPPINGS *diff_prune-mappings*
*<Plug>DiffPrune*
-A single mapping target name for two mods |<Plug>DiffPrune| is provided.
-
-If the user's configuration does not specify a mapping to this target by the
-time this plugin is loaded, the plugin will attempt to remap normal and visual
-`<LocalLeader>p` to this target.
-
+A single mapping target name `<Plug>DiffPrune` for normal and visual modes
+provided. You could put this in your `~/.vimrc` to use `<LocalLeader>p`:
+>
+ augroup vimrc
+ autocmd!
+ autocmd FileType diff nmap <LocalLeader>p <Plug>DiffPrune
+ autocmd FileType diff xmap <LocalLeader>p <Plug>DiffPrune
+ auground END
+<
AUTHOR *diff_prune-author*
Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.