diff options
author | Josh Rahm <rahm@google.com> | 2022-09-13 18:16:30 -0600 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2022-09-13 18:16:30 -0600 |
commit | 2dd5ac29ec6cdaa4ee7a45314d29559d2294cac0 (patch) | |
tree | 24ef10b2f3dea8a6d5b2740b1b78831a15e89b55 /plugin/insert.vim | |
parent | 79b37fdd282f616714876b97e484d8dcc8a488ab (diff) | |
download | fieldmarshal.vim-stuff.tar.gz fieldmarshal.vim-stuff.tar.bz2 fieldmarshal.vim-stuff.zip |
assortment of stuffstuff
Diffstat (limited to 'plugin/insert.vim')
-rw-r--r-- | plugin/insert.vim | 14 |
1 files changed, 14 insertions, 0 deletions
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 <cmd>call <sid>insert_comment_count(v:count1)<cr>1c<Plug><sid>(inser onoremap <Plug><sid>(insert-comment-obj-nog) <cmd>call <sid>insert_comment_obj(0)<cr> onoremap <Plug><sid>(insert-comment-obj-g) <cmd>call <sid>insert_comment_obj(1)<cr> +onoremap <plug>(insert-here-obj) <cmd>normal! "i <esc>v" + +let s:motions = ['b', 'w', 'ib', 'ab'] + +for m in s:motions + exec "onoremap <Plug>(mot-before-" . m . ") <cmd>call g:BeforeMot(\"" . m . "\")<cr>" + exec "noremap dI" . m . " c<Plug>(mot-before-" . m . ")" +endfor + +function! g:BeforeMot(mot) abort + exec "normal! " . a:mot + exec "normal! \<esc>i \<esc>v" +endfunction + function! s:insert_comment_count(count) abort let s:count = a:count endfunction |