diff options
author | Josh Rahm <rahm@google.com> | 2024-03-08 19:34:20 +0000 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2024-03-08 19:34:20 +0000 |
commit | fd5de6e1630c9e3a5966eb4101e376863676e58d (patch) | |
tree | b6d483804abee1d6888e2e77819755877c332f12 /plugin/commenter.vim | |
parent | c8ef92cfb59f28c050b82e90fb813d25392e6664 (diff) | |
download | fieldmarshal.vim-fd5de6e1630c9e3a5966eb4101e376863676e58d.tar.gz fieldmarshal.vim-fd5de6e1630c9e3a5966eb4101e376863676e58d.tar.bz2 fieldmarshal.vim-fd5de6e1630c9e3a5966eb4101e376863676e58d.zip |
Bunch of changes.
Salient changes are:
Get rid of object remapping the quotes (i/a "/'/`) in favor of adding
a new text object "next quotes" such as cin"/can"/etc.
Added mappings in visual mode that behave like "fall", but for
matching characters. So <C-v>ic will highlight the current character
and all of the same character up and down. Super useful for making
edits to columns of identical characters.
Added a text object ic/ac that highlight all the lines that match.
removed the uncommented paragraph text objects as they're broken
anyway.
Diffstat (limited to 'plugin/commenter.vim')
-rw-r--r-- | plugin/commenter.vim | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/plugin/commenter.vim b/plugin/commenter.vim index f903fce..8d283c3 100644 --- a/plugin/commenter.vim +++ b/plugin/commenter.vim @@ -13,11 +13,6 @@ vnoremap i/ <cmd>call <sid>comment_obj('', 'i')<cr> onoremap a/ <cmd>call <sid>comment_obj(v:operator, 'a')<cr> vnoremap a/ <cmd>call <sid>comment_obj('', 'a')<cr> -" Objects for paragraphs excluding any comment blocks immediately preceeding or -" Succeeding -onoremap acp <cmd>call <sid>uncommented_paragraph('a')<cr> -onoremap icp <cmd>call <sid>uncommented_paragraph('i')<cr> - noremap czd <cmd>set operatorfunc=<sid>uncomment<cr>g@ nnoremap czdd <cmd>set operatorfunc=<sid>uncomment<cr>g@_ @@ -71,27 +66,6 @@ function! s:minpos(cur, oth) endfunction -function! s:uncommented_paragraph(t) abort - let savepos = getpos('.') - set operatorfunc=s:save_object - exec "normal! g@". a:t . "pv\<esc>" - call setpos('.', savepos) - - let [start_regex, end_regex] = g:GetCommentRegex('a') - - call search(end_regex . '\|\%^', 'cb') - exec "normal! j" - call setpos('.', s:maxpos(getpos('.'), s:object.start)) - normal! m< - call setpos('.', savepos) - - call search(start_regex . '\|\%$', 'c') - call setpos('.', s:minpos(getpos('.'), s:object.end)) - exec "normal! k" - - normal! m>gvV -endfunction - function! s:regex_combine(s1, s2) abort if a:s1 == "" return a:s2 |