From 534f8ccabd777d419fc88aed28c7dc10a6637392 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 15 Sep 2022 20:54:46 +0000 Subject: fieldmarshal: some minor changes. --- plugin/insert.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugin/insert.vim') 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 (insert-before-motion) noremap Za (append-after-motion) + + vnoremap Zi "\'<" . (visualmode() == "V" ? "0" : "") . "i" + vnoremap Za "\'>" . (visualmode() == "V" ? "$" : "") . "a" endif noremap (insert-after-comment) call insert_comment_count(v:count1)1c(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 -- cgit