diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-29 23:01:20 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-29 23:01:20 +1300 |
commit | 5c63d2da1e96d4d399c7319faa0577ee278a6e2a (patch) | |
tree | 0d9149a0364f05e9fd0fdfe3c05832dbb276761b /plugin | |
parent | Correct use of plural in documentation (diff) | |
download | vim-replace-operator-5c63d2da1e96d4d399c7319faa0577ee278a6e2a.tar.gz vim-replace-operator-5c63d2da1e96d4d399c7319faa0577ee278a6e2a.zip |
Refactor with expression mappings and simpler alg
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/replace_operator.vim | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugin/replace_operator.vim b/plugin/replace_operator.vim index a5c4a95..982b573 100644 --- a/plugin/replace_operator.vim +++ b/plugin/replace_operator.vim @@ -1,6 +1,6 @@ " -" replace_operator.vim: Replace text selected with a motion with the -" contents of a register in a repeatable way. +" replace_operator.vim: Replace text selected with a motion with the contents +" of a register in a repeatable way. " " Author: Tom Ryder <tom@sanctum.geek.nz> " License: Same as Vim itself @@ -14,9 +14,7 @@ endif let g:loaded_replace_operator = 1 " Set up mapping -nnoremap <silent> <unique> - \ <Plug>(ReplaceOperator) - \ :<C-U>call replace_operator#MapNormal(v:register)<CR>g@ -xnoremap <silent> <unique> - \ <Plug>(ReplaceOperator) - \ :<C-U>call replace_operator#MapVisual(v:register, visualmode())<CR> +nnoremap <expr> <Plug>(ReplaceOperator) + \ replace_operator#Map() +xnoremap <expr> <Plug>(ReplaceOperator) + \ replace_operator#Map() |