Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions plugin/commentary.vim
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,20 @@ function! s:textobject(inner) abort
endfunction

command! -range -bar -bang Commentary call s:go(<line1>,<line2>,<bang>0)
xnoremap <expr> <Plug>Commentary <SID>go()
nnoremap <expr> <Plug>Commentary <SID>go()
nnoremap <expr> <Plug>CommentaryLine <SID>go() . '_'
onoremap <silent> <Plug>Commentary :<C-U>call <SID>textobject(get(v:, 'operator', '') ==# 'c')<CR>
nnoremap <silent> <Plug>ChangeCommentary c:<C-U>call <SID>textobject(1)<CR>
xnoremap <expr> <Plug>(Commentary) <SID>go()
nnoremap <expr> <Plug>(Commentary) <SID>go()
nnoremap <expr> <Plug>(CommentaryLine) <SID>go() . '_'
onoremap <silent> <Plug>(Commentary) :<C-U>call <SID>textobject(get(v:, 'operator', '') ==# 'c')<CR>
nnoremap <silent> <Plug>(ChangeCommentary) c:<C-U>call <SID>textobject(1)<CR>

if !hasmapto('<Plug>Commentary') || maparg('gc','n') ==# ''
xmap gc <Plug>Commentary
nmap gc <Plug>Commentary
omap gc <Plug>Commentary
nmap gcc <Plug>CommentaryLine
nmap gcu <Plug>Commentary<Plug>Commentary
if !hasmapto('<Plug>(Commentary)') || maparg('gc','n') ==# ''
xmap gc <Plug>(Commentary)
nmap gc <Plug>(Commentary)
omap gc <Plug>(Commentary)
nmap gcc <Plug>(CommentaryLine)
nmap gcu <Plug>(Commentary)<Plug>(Commentary)
endif

nmap <silent> <Plug>CommentaryUndo :echoerr "Change your <Plug>CommentaryUndo map to <Plug>Commentary<Plug>Commentary"<CR>
nmap <silent> <Plug>(CommentaryUndo) :echoerr "Change your <Plug>(CommentaryUndo) map to <Plug>(Commentary)<Plug>(Commentary)"<CR>

" vim:set et sw=2: