1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated plugins

This commit is contained in:
amix
2014-07-02 12:18:18 +01:00
parent 6a16a9393c
commit 1dba960b75
156 changed files with 2657 additions and 1234 deletions

View File

@ -3,7 +3,9 @@
Comment stuff out. Use `gcc` to comment out a line (takes a count),
`gc` to comment out the target of a motion (for example, `gcap` to
comment out a paragraph), `gc` in visual mode to comment out the selection,
and `gc` in operator pending mode to target a comment. That's it.
and `gc` in operator pending mode to target a comment. You can also use
it as a command, either with a range like `:7,17Commentary`, or as part of a
`:global` invocation like with `:g/TODO/Commentary`. That's it.
I wrote this because 5 years after Vim added support for mapping an
operator, I still couldn't find a commenting plugin that leveraged that

View File

@ -26,6 +26,9 @@ gc Text object for a comment (operator pending mode
gcgc Uncomment the current and adjacent commented lines.
gcu
*:Commentary*
:[range]Commentary Comment or uncomment [range] lines
The |User| CommentaryPost autocommand fires after a successful operation and
can be used for advanced customization.

View File

@ -79,6 +79,7 @@ nnoremap <silent> <Plug>CommentaryLine :<C-U>set opfunc=<SID>go<Bar>exe 'norm! '
onoremap <silent> <Plug>Commentary :<C-U>call <SID>textobject(0)<CR>
nnoremap <silent> <Plug>ChangeCommentary c:<C-U>call <SID>textobject(1)<CR>
nmap <silent> <Plug>CommentaryUndo <Plug>Commentary<Plug>Commentary
command! -range -bar Commentary call s:go(<line1>,<line2>)
if 1 || !hasmapto('<Plug>Commentary') || maparg('gc','n') ==# ''
xmap gc <Plug>Commentary