diff options
author | Josh Rahm <rahm@google.com> | 2022-09-15 20:54:46 +0000 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2022-09-15 20:54:46 +0000 |
commit | 534f8ccabd777d419fc88aed28c7dc10a6637392 (patch) | |
tree | d7b5ab9e47e200f64e94fed457441534a15c70bc /plugin/insert.vim | |
parent | 445bdd5b7c8794b7961926dbe660970ff5df5373 (diff) | |
download | fieldmarshal.vim-534f8ccabd777d419fc88aed28c7dc10a6637392.tar.gz fieldmarshal.vim-534f8ccabd777d419fc88aed28c7dc10a6637392.tar.bz2 fieldmarshal.vim-534f8ccabd777d419fc88aed28c7dc10a6637392.zip |
fieldmarshal: some minor changes.
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 |