aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-29 23:01:20 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-29 23:01:20 +1300
commit5c63d2da1e96d4d399c7319faa0577ee278a6e2a (patch)
tree0d9149a0364f05e9fd0fdfe3c05832dbb276761b /plugin
parentCorrect use of plural in documentation (diff)
downloadvim-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.vim14
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()