diff options
Diffstat (limited to 'plugin/insert.vim')
-rw-r--r-- | plugin/insert.vim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugin/insert.vim b/plugin/insert.vim index 3caca81..dea819a 100644 --- a/plugin/insert.vim +++ b/plugin/insert.vim @@ -57,6 +57,9 @@ if g:field_marshal_insert_include_bindings " noremap Zi <Plug>(insert-before-motion) noremap Za <Plug>(append-after-motion) + + vnoremap <expr> Zi "\<esc>'<" . (visualmode() == "V" ? "0" : "") . "i" + vnoremap <expr> Za "\<esc>'>" . (visualmode() == "V" ? "$" : "") . "a" endif noremap <Plug>(insert-after-comment) <cmd>call <sid>insert_comment_count(v:count1)<cr>1c<Plug><sid>(insert-comment-obj-nog) @@ -171,8 +174,8 @@ function! s:insert_before_recorded() abort " Something of a hack. If the motion starts with i or a, it is probably a " text object. " - " I think there's probably a better way to handle this, butth - if s:recorded =~ '^[ia]' + " I think there's probably a better way to handle this, but + if s:recorded =~ '^[ia]' || s:recorded =~ 'g[nN]' || s:recorded =~ '[_]' " Without Rahm's patched Neovim, custom text objects will not work. This is " because while the redo buffer is saved and restored when calling a user " function, repeat_cmdline is not, and thus the g@ command clobbers the |