diff options
author | Teddy Wing | 2020-02-05 23:13:43 +0100 |
---|---|---|
committer | Teddy Wing | 2020-02-05 23:13:43 +0100 |
commit | 3b417b4aa2fd78f72e180ca87a3fd65786ffc340 (patch) | |
tree | 0b9b20c498e7375d9a8ba4e4189af32e1a1a1cee | |
parent | c292377efc09f8ecdfbf55873d72dec1927dac63 (diff) | |
download | vim-searchop-3b417b4aa2fd78f72e180ca87a3fd65786ffc340.tar.bz2 |
plugin/searchop.vim: Add `<Plug>` mappings
Move hard-coded `z#` and `z*` mappings to `<Plug>` mappings.
-rw-r--r-- | plugin/searchop.vim | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/plugin/searchop.vim b/plugin/searchop.vim index d588456..86bc5d6 100644 --- a/plugin/searchop.vim +++ b/plugin/searchop.vim @@ -4,8 +4,21 @@ endif let g:loaded_searchop = 1 -nnoremap <silent> z* :set opfunc=searchop#SearchForward<CR>g@ -vnoremap <silent> z* :<C-u>call searchop#SearchForward(visualmode(), 1)<CR> +nnoremap <silent> <Plug>(searchop-forward) :set opfunc=searchop#SearchForward<CR>g@ +vnoremap <silent> <Plug>(searchop-forward) + \ :<C-u>call searchop#SearchForward(visualmode(), 1)<CR> -nnoremap <silent> z# :set opfunc=searchop#SearchBackward<CR>g@ -vnoremap <silent> z# :<C-u>call searchop#SearchBackward(visualmode(), 1)<CR> +nnoremap <silent> <Plug>(searchop-backward) :set opfunc=searchop#SearchBackward<CR>g@ +vnoremap <silent> <Plug>(searchop-backward) + \ :<C-u>call searchop#SearchBackward(visualmode(), 1)<CR> + + +if !hasmapto('<Plug>(searchop-forward)') && !maparg('z*', 'n') + nmap z* <Plug>(searchop-forward) + vmap z* <Plug>(searchop-forward) +endif + +if !hasmapto('<Plug>(searchop-backward)') && !maparg('z#', 'n') + nmap z# <Plug>(searchop-backward) + vmap z# <Plug>(searchop-backward) +endif |