mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 05:20:04 +08:00
Fix SPC c t
This commit is contained in:
parent
0f56158bc7
commit
edd3439e65
@ -79,8 +79,8 @@ function! SpaceVim#mapping#space#init() abort
|
|||||||
call SpaceVim#mapping#space#def('nmap', ['c', 'p'], 'vip<Plug>NERDCommenterComment', 'comment paragraphs', 0, 1)
|
call SpaceVim#mapping#space#def('nmap', ['c', 'p'], 'vip<Plug>NERDCommenterComment', 'comment paragraphs', 0, 1)
|
||||||
call SpaceVim#mapping#space#def('nmap', ['c', 'P'], 'vip<Plug>NERDCommenterInvert', 'toggle comment paragraphs', 0, 1)
|
call SpaceVim#mapping#space#def('nmap', ['c', 'P'], 'vip<Plug>NERDCommenterInvert', 'toggle comment paragraphs', 0, 1)
|
||||||
|
|
||||||
nnoremap <silent> <Plug>CommentToLine :<SID>comment_to_line(0)<Cr>
|
nnoremap <silent> <Plug>CommentToLine :call <SID>comment_to_line(0)<Cr>
|
||||||
nnoremap <silent> <Plug>CommentToLineInvert :<SID>comment_to_line(1)<Cr>
|
nnoremap <silent> <Plug>CommentToLineInvert :call <SID>comment_to_line(1)<Cr>
|
||||||
call SpaceVim#mapping#space#def('nmap', ['c', 't'], '<Plug>CommentToLine', 'comment to line', 0, 1)
|
call SpaceVim#mapping#space#def('nmap', ['c', 't'], '<Plug>CommentToLine', 'comment to line', 0, 1)
|
||||||
call SpaceVim#mapping#space#def('nmap', ['c', 'T'], '<Plug>CommentToLineInvert', 'toggle comment to line', 0, 1)
|
call SpaceVim#mapping#space#def('nmap', ['c', 'T'], '<Plug>CommentToLineInvert', 'toggle comment to line', 0, 1)
|
||||||
|
|
||||||
@ -336,13 +336,17 @@ function! s:commentOperator(type, ...)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:comment_to_line(invert) abort
|
function! s:comment_to_line(invert) abort
|
||||||
let line = str2nr(input('line number :'))
|
let input = input('line number :')
|
||||||
|
if empty(input)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let line = str2nr(input)
|
||||||
let ex = line - line('.')
|
let ex = line - line('.')
|
||||||
if ex > 0
|
if ex > 0
|
||||||
exe 'normal! V'. ex .'j'
|
exe 'normal! V'. ex .'j'
|
||||||
elseif ex == 0
|
elseif ex == 0
|
||||||
else
|
else
|
||||||
exe 'normal! V'. ex .'k'
|
exe 'normal! V'. abs(ex) .'k'
|
||||||
endif
|
endif
|
||||||
if a:invert
|
if a:invert
|
||||||
call feedkeys("\<Plug>NERDCommenterInvert")
|
call feedkeys("\<Plug>NERDCommenterInvert")
|
||||||
|
Loading…
Reference in New Issue
Block a user