From 2dd5ac29ec6cdaa4ee7a45314d29559d2294cac0 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Tue, 13 Sep 2022 18:16:30 -0600 Subject: assortment of stuff --- plugin/insert.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'plugin/insert.vim') diff --git a/plugin/insert.vim b/plugin/insert.vim index c6de7a2..3d27f78 100644 --- a/plugin/insert.vim +++ b/plugin/insert.vim @@ -17,6 +17,20 @@ noremap cgI call insert_comment_count(v:count1)1c(inser onoremap (insert-comment-obj-nog) call insert_comment_obj(0) onoremap (insert-comment-obj-g) call insert_comment_obj(1) +onoremap (insert-here-obj) normal! "i v" + +let s:motions = ['b', 'w', 'ib', 'ab'] + +for m in s:motions + exec "onoremap (mot-before-" . m . ") call g:BeforeMot(\"" . m . "\")" + exec "noremap dI" . m . " c(mot-before-" . m . ")" +endfor + +function! g:BeforeMot(mot) abort + exec "normal! " . a:mot + exec "normal! \i \v" +endfunction + function! s:insert_comment_count(count) abort let s:count = a:count endfunction -- cgit