mirror of
https://github.com/amix/vimrc
synced 2025-06-23 06:35:01 +08:00
Updated plugins
This commit is contained in:
2
sources_non_forked/vim-commentary/.github/FUNDING.yml
vendored
Normal file
2
sources_non_forked/vim-commentary/.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
github: tpope
|
||||
custom: ["https://www.paypal.me/vimpope"]
|
@ -6,6 +6,9 @@ License: Same terms as Vim itself (see |license|)
|
||||
Comment stuff out. Then uncomment it later. Relies on 'commentstring' to be
|
||||
correctly set, or uses b:commentary_format if it is set.
|
||||
|
||||
Assign b:commentary_startofline to insert comment characters at column 1
|
||||
regardless of indentation.
|
||||
|
||||
*gc*
|
||||
gc{motion} Comment or uncomment lines that {motion} moves over.
|
||||
|
||||
|
@ -44,6 +44,12 @@ function! s:go(...) abort
|
||||
endif
|
||||
endfor
|
||||
|
||||
if get(b:, 'commentary_startofline')
|
||||
let indent = '^'
|
||||
else
|
||||
let indent = '^\s*'
|
||||
endif
|
||||
|
||||
for lnum in range(lnum1,lnum2)
|
||||
let line = getline(lnum)
|
||||
if strlen(r) > 2 && l.r !~# '\\'
|
||||
@ -54,7 +60,7 @@ function! s:go(...) abort
|
||||
if uncomment
|
||||
let line = substitute(line,'\S.*\s\@<!','\=submatch(0)[strlen(l):-strlen(r)-1]','')
|
||||
else
|
||||
let line = substitute(line,'^\%('.matchstr(getline(lnum1),'^\s*').'\|\s*\)\zs.*\S\@<=','\=l.submatch(0).r','')
|
||||
let line = substitute(line,'^\%('.matchstr(getline(lnum1),indent).'\|\s*\)\zs.*\S\@<=','\=l.submatch(0).r','')
|
||||
endif
|
||||
call setline(lnum,line)
|
||||
endfor
|
||||
|
Reference in New Issue
Block a user