GetLatestVimScripts

This commit is contained in:
Stefan Liebl 2015-01-28 13:33:31 +01:00
parent 9f530c0a76
commit 844e12f6aa
10 changed files with 2054 additions and 784 deletions

View File

@ -19,14 +19,14 @@ ScriptID SourceID Filename
1046 4249 Lusty Explorer 1046 4249 Lusty Explorer
2043 7805 VimPdb (debugging python) 2043 7805 VimPdb (debugging python)
1776 7902 Vimgrep Replace 1776 7902 Vimgrep Replace
3745 16823 LineDiff 3745 22834 LineDiff
39 8196 matchit.vim 39 8196 matchit.vim
2092 8095 reloaded.vim (matrix colorscheme) 2092 8095 reloaded.vim (matrix colorscheme)
848 14668 SrchRplcHiGrp.vim (Search/Replace on Syntax Group) 848 14668 SrchRplcHiGrp.vim (Search/Replace on Syntax Group)
294 19633 Align.vim 294 19633 Align.vim
479 9276 MultipleSearch.vba 479 9276 MultipleSearch.vba
1066 7618 cecutil.vim 1066 7618 cecutil.vim
1173 21766 tComment.vim 1173 22422 tComment.vim
2701 18988 editsrec 2701 18988 editsrec
3280 14334 Tabbi 3280 14334 Tabbi
642 15781 :AutoInstall: getscript.vim 642 15781 :AutoInstall: getscript.vim
@ -35,4 +35,4 @@ ScriptID SourceID Filename
3304 20505 Gundo 3304 20505 Gundo
90 19809 vcscommand 90 19809 vcscommand
974 4316 python.vim (indent) 974 4316 python.vim (indent)
2975 15542 fugitive.vim 2975 22815 fugitive.vim

View File

@ -16,7 +16,9 @@ function! linediff#differ#New(sign_name, sign_number)
\ 'Init': function('linediff#differ#Init'), \ 'Init': function('linediff#differ#Init'),
\ 'IsBlank': function('linediff#differ#IsBlank'), \ 'IsBlank': function('linediff#differ#IsBlank'),
\ 'Reset': function('linediff#differ#Reset'), \ 'Reset': function('linediff#differ#Reset'),
\ 'CloseAndReset': function('linediff#differ#CloseAndReset'),
\ 'Lines': function('linediff#differ#Lines'), \ 'Lines': function('linediff#differ#Lines'),
\ 'Indent': function('linediff#differ#Indent'),
\ 'CreateDiffBuffer': function('linediff#differ#CreateDiffBuffer'), \ 'CreateDiffBuffer': function('linediff#differ#CreateDiffBuffer'),
\ 'SetupDiffBuffer': function('linediff#differ#SetupDiffBuffer'), \ 'SetupDiffBuffer': function('linediff#differ#SetupDiffBuffer'),
\ 'CloseDiffBuffer': function('linediff#differ#CloseDiffBuffer'), \ 'CloseDiffBuffer': function('linediff#differ#CloseDiffBuffer'),
@ -51,8 +53,6 @@ endfunction
" Resets the differ to the blank state. Invoke `Init(from, to)` on it later to " Resets the differ to the blank state. Invoke `Init(from, to)` on it later to
" make it usable again. " make it usable again.
function! linediff#differ#Reset() dict function! linediff#differ#Reset() dict
call self.CloseDiffBuffer()
let self.original_buffer = -1 let self.original_buffer = -1
let self.diff_buffer = -1 let self.diff_buffer = -1
let self.filetype = '' let self.filetype = ''
@ -66,6 +66,13 @@ function! linediff#differ#Reset() dict
let self.is_blank = 1 let self.is_blank = 1
endfunction endfunction
" Closes the diff buffer and resets. The two actions are separate to avoid
" problems with closing already closed buffers.
function! linediff#differ#CloseAndReset(force) dict
call self.CloseDiffBuffer(a:force)
call self.Reset()
endfunction
" Extracts the relevant lines from the original buffer and returns them as a " Extracts the relevant lines from the original buffer and returns them as a
" list. " list.
function! linediff#differ#Lines() dict function! linediff#differ#Lines() dict
@ -76,19 +83,40 @@ endfunction
" object. " object.
function! linediff#differ#CreateDiffBuffer(edit_command) dict function! linediff#differ#CreateDiffBuffer(edit_command) dict
let lines = self.Lines() let lines = self.Lines()
if g:linediff_buffer_type == 'tempfile'
let temp_file = tempname() let temp_file = tempname()
exe a:edit_command . " " . temp_file silent exe a:edit_command . " " . temp_file
call append(0, lines) call append(0, lines)
normal! Gdd silent $delete _
set nomodified set nomodified
normal! gg
else " g:linediff_buffer_type == 'scratch'
silent exe a:edit_command
call append(0, lines)
silent $delete _
setlocal buftype=acwrite
setlocal bufhidden=wipe
endif
let self.diff_buffer = bufnr('%') let self.diff_buffer = bufnr('%')
call self.SetupDiffBuffer() call self.SetupDiffBuffer()
call self.Indent()
diffthis diffthis
endfunction endfunction
" Indents the current buffer content so that format can be ignored.
function! linediff#differ#Indent() dict
if g:linediff_indent
silent normal! gg=G
endif
endfunction
" Sets up the temporary buffer's filetype and statusline. " Sets up the temporary buffer's filetype and statusline.
" "
" Attempts to leave the current statusline as it is, and simply add the " Attempts to leave the current statusline as it is, and simply add the
@ -97,20 +125,30 @@ endfunction
function! linediff#differ#SetupDiffBuffer() dict function! linediff#differ#SetupDiffBuffer() dict
let b:differ = self let b:differ = self
if g:linediff_buffer_type == 'tempfile'
let statusline = printf('[%s:%%{b:differ.from}-%%{b:differ.to}]', bufname(self.original_buffer)) let statusline = printf('[%s:%%{b:differ.from}-%%{b:differ.to}]', bufname(self.original_buffer))
if &statusline =~ '%[fF]' if &statusline =~ '%[fF]'
let statusline = substitute(&statusline, '%[fF]', statusline, '') let statusline = substitute(&statusline, '%[fF]', escape(statusline, '\'), '')
endif endif
exe "setlocal statusline=" . escape(statusline, ' |') let &l:statusline = statusline
exe "set filetype=" . self.filetype exe "set filetype=" . self.filetype
setlocal bufhidden=hide setlocal bufhidden=wipe
autocmd BufWrite <buffer> silent call b:differ.UpdateOriginalBuffer() autocmd BufWrite <buffer> silent call b:differ.UpdateOriginalBuffer()
else " g:linediff_buffer_type == 'scratch'
let description = printf('[%s:%s-%s]', bufname(self.original_buffer), self.from, self.to)
silent exec 'keepalt file ' . escape(description, '[')
exe "set filetype=" . self.filetype
set nomodified
autocmd BufWriteCmd <buffer> silent call b:differ.UpdateOriginalBuffer()
endif
endfunction endfunction
function! linediff#differ#CloseDiffBuffer() dict function! linediff#differ#CloseDiffBuffer(force) dict
if bufexists(self.diff_buffer) if bufexists(self.diff_buffer)
exe "bdelete ".self.diff_buffer let bang = a:force ? '!' : ''
exe "bdelete".bang." ".self.diff_buffer
endif endif
endfunction endfunction
@ -126,17 +164,25 @@ endfunction
" update the other differ's data, provided a few conditions are met. See " update the other differ's data, provided a few conditions are met. See
" linediff#differ#PossiblyUpdateOtherDiffer() for details. " linediff#differ#PossiblyUpdateOtherDiffer() for details.
function! linediff#differ#UpdateOriginalBuffer() dict function! linediff#differ#UpdateOriginalBuffer() dict
if self.IsBlank()
return
endif
let saved_diff_buffer_view = winsaveview()
let new_lines = getbufline('%', 0, '$') let new_lines = getbufline('%', 0, '$')
" Switch to the original buffer, delete the relevant lines, add the new " Switch to the original buffer, delete the relevant lines, add the new
" ones, switch back to the diff buffer. " ones, switch back to the diff buffer.
set bufhidden=hide
call linediff#util#SwitchBuffer(self.original_buffer) call linediff#util#SwitchBuffer(self.original_buffer)
let saved_cursor = getpos('.') let saved_original_buffer_view = winsaveview()
call cursor(self.from, 1) call cursor(self.from, 1)
exe "silent! ".(self.to - self.from + 1)."foldopen!"
exe "normal! ".(self.to - self.from + 1)."dd" exe "normal! ".(self.to - self.from + 1)."dd"
call append(self.from - 1, new_lines) call append(self.from - 1, new_lines)
call setpos('.', saved_cursor) call winrestview(saved_original_buffer_view)
call linediff#util#SwitchBuffer(self.diff_buffer) call linediff#util#SwitchBuffer(self.diff_buffer)
set bufhidden=wipe
" Keep the difference in lines to know how to update the other differ if " Keep the difference in lines to know how to update the other differ if
" necessary. " necessary.
@ -148,6 +194,7 @@ function! linediff#differ#UpdateOriginalBuffer() dict
call self.SetupSigns() call self.SetupSigns()
call self.PossiblyUpdateOtherDiffer(new_line_count - line_count) call self.PossiblyUpdateOtherDiffer(new_line_count - line_count)
call winrestview(saved_diff_buffer_view)
endfunction endfunction
" If the other differ originates from the same buffer and it's located below " If the other differ originates from the same buffer and it's located below

View File

@ -2,8 +2,8 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037 " @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2007-09-17. " @Created: 2007-09-17.
" @Last Change: 2014-02-05. " @Last Change: 2014-06-25.
" @Revision: 1587 " @Revision: 1656
" call tlog#Log('Load: '. expand('<sfile>')) " vimtlib-sfile " call tlog#Log('Load: '. expand('<sfile>')) " vimtlib-sfile
@ -48,13 +48,15 @@ if !exists('g:tcommentOptions')
endif endif
if !exists('g:tcomment#options_comments') if !exists('g:tcomment#options_comments')
" Options when using a the 'comments' option. " Additional args for |tcomment#Comment()| when using the 'comments'
let g:tcomment#options_comments = {'whitespace': 'both'} "{{{2 " option.
let g:tcomment#options_comments = {'whitespace': get(g:tcommentOptions, 'whitespace', 'both')} "{{{2
endif endif
if !exists('g:tcomment#options_commentstring') if !exists('g:tcomment#options_commentstring')
" Options when using a the 'commentstring' option. " Additional args for |tcomment#Comment()| when using the
let g:tcomment#options_commentstring = {'whitespace': 'both'} "{{{2 " 'commentstring' option.
let g:tcomment#options_commentstring = {'whitespace': get(g:tcommentOptions, 'whitespace', 'both')} "{{{2
endif endif
if !exists('g:tcomment#ignore_char_type') if !exists('g:tcomment#ignore_char_type')
@ -252,6 +254,22 @@ if !exists('g:tcomment#ignore_comment_def')
let g:tcomment#ignore_comment_def = [] "{{{2 let g:tcomment#ignore_comment_def = [] "{{{2
endif endif
if !exists('g:tcomment#must_escape_expression_backslash')
" Users of vim earlier than 7.3 might have to set this variable to
" true. Set this variable to 0, if you see unexpected "\r" char
" sequences in comments.
"
" The reommended value was `!(v:version > 702 || (v:version == 702 && has('patch407')))`.
" It is now assumed though, that no unpatched versions of vim are in
" use.
"
" References:
" Patch 7.2.407 when using :s with an expression backslashes are dropped
" https://github.com/tomtom/tcomment_vim/issues/102
let g:tcomment#must_escape_expression_backslash = 0 "{{{2
endif
let s:types_dirty = 1 let s:types_dirty = 1
let s:definitions = {} let s:definitions = {}
@ -330,6 +348,7 @@ call tcomment#DefineType('ada', '-- %s' )
call tcomment#DefineType('apache', '# %s' ) call tcomment#DefineType('apache', '# %s' )
call tcomment#DefineType('asciidoc', '// %s' ) call tcomment#DefineType('asciidoc', '// %s' )
call tcomment#DefineType('asm', '; %s' ) call tcomment#DefineType('asm', '; %s' )
call tcomment#DefineType('asterisk', '; %s' )
call tcomment#DefineType('blade', '{{-- %s --}}' ) call tcomment#DefineType('blade', '{{-- %s --}}' )
call tcomment#DefineType('blade_block', '{{-- %s --}}' ) call tcomment#DefineType('blade_block', '{{-- %s --}}' )
call tcomment#DefineType('blade_inline', '{{-- %s --}}' ) call tcomment#DefineType('blade_inline', '{{-- %s --}}' )
@ -347,6 +366,7 @@ call tcomment#DefineType('clojurescript_inline', '; %s' )
call tcomment#DefineType('cmake', '# %s' ) call tcomment#DefineType('cmake', '# %s' )
call tcomment#DefineType('coffee', '# %s' ) call tcomment#DefineType('coffee', '# %s' )
call tcomment#DefineType('conf', '# %s' ) call tcomment#DefineType('conf', '# %s' )
call tcomment#DefineType('context', '%% %s' )
call tcomment#DefineType('conkyrc', '# %s' ) call tcomment#DefineType('conkyrc', '# %s' )
call tcomment#DefineType('cpp', '// %s' ) call tcomment#DefineType('cpp', '// %s' )
call tcomment#DefineType('cpp_block', g:tcommentBlockC ) call tcomment#DefineType('cpp_block', g:tcommentBlockC )
@ -371,6 +391,7 @@ call tcomment#DefineType('dsl', '; %s' )
call tcomment#DefineType('dustjs', '{! %s !}' ) call tcomment#DefineType('dustjs', '{! %s !}' )
call tcomment#DefineType('dylan', '// %s' ) call tcomment#DefineType('dylan', '// %s' )
call tcomment#DefineType('eiffel', '-- %s' ) call tcomment#DefineType('eiffel', '-- %s' )
call tcomment#DefineType('elixir', '# %s' )
call tcomment#DefineType('erlang', '%%%% %s' ) call tcomment#DefineType('erlang', '%%%% %s' )
call tcomment#DefineType('eruby', '<%%# %s' ) call tcomment#DefineType('eruby', '<%%# %s' )
call tcomment#DefineType('esmtprc', '# %s' ) call tcomment#DefineType('esmtprc', '# %s' )
@ -402,6 +423,7 @@ call tcomment#DefineType('htmljinja_block', "{%% comment %%}%s{%% endcomment %%}
call tcomment#DefineType('hy', '; %s' ) call tcomment#DefineType('hy', '; %s' )
call tcomment#DefineType('ini', '; %s' ) " php ini (/etc/php5/...) call tcomment#DefineType('ini', '; %s' ) " php ini (/etc/php5/...)
call tcomment#DefineType('io', '// %s' ) call tcomment#DefineType('io', '// %s' )
call tcomment#DefineType('jade', '// %s' )
call tcomment#DefineType('jasmine', '# %s' ) call tcomment#DefineType('jasmine', '# %s' )
call tcomment#DefineType('java', '/* %s */' ) call tcomment#DefineType('java', '/* %s */' )
call tcomment#DefineType('java_block', g:tcommentBlockC ) call tcomment#DefineType('java_block', g:tcommentBlockC )
@ -427,6 +449,7 @@ call tcomment#DefineType('msidl', '// %s' )
call tcomment#DefineType('msidl_block', g:tcommentBlockC ) call tcomment#DefineType('msidl_block', g:tcommentBlockC )
call tcomment#DefineType('nginx', '# %s' ) call tcomment#DefineType('nginx', '# %s' )
call tcomment#DefineType('nroff', '.\\" %s' ) call tcomment#DefineType('nroff', '.\\" %s' )
call tcomment#DefineType('noweb', '%% %s' )
call tcomment#DefineType('nsis', '# %s' ) call tcomment#DefineType('nsis', '# %s' )
call tcomment#DefineType('objc', '/* %s */' ) call tcomment#DefineType('objc', '/* %s */' )
call tcomment#DefineType('objc_block', g:tcommentBlockC ) call tcomment#DefineType('objc_block', g:tcommentBlockC )
@ -449,6 +472,9 @@ call tcomment#DefineType('php_inline', g:tcommentInlineC )
call tcomment#DefineType('po', '# %s' ) call tcomment#DefineType('po', '# %s' )
call tcomment#DefineType('prolog', '%% %s' ) call tcomment#DefineType('prolog', '%% %s' )
call tcomment#DefineType('puppet', '# %s' ) call tcomment#DefineType('puppet', '# %s' )
call tcomment#DefineType('purescript', '-- %s' )
call tcomment#DefineType('purescript_block', "{-%s-}\n " )
call tcomment#DefineType('purescript_inline','{- %s -}' )
call tcomment#DefineType('python', '# %s' ) call tcomment#DefineType('python', '# %s' )
call tcomment#DefineType('qml', '// %s' ) call tcomment#DefineType('qml', '// %s' )
call tcomment#DefineType('r', '# %s' ) call tcomment#DefineType('r', '# %s' )
@ -588,11 +614,14 @@ let s:null_comment_string = '%s'
" comment_mode (see also ¦g:tcommentModeExtra¦): " comment_mode (see also ¦g:tcommentModeExtra¦):
" G ... guess the value of comment_mode " G ... guess the value of comment_mode
" B ... block (use extra lines for the comment markers) " B ... block (use extra lines for the comment markers)
" L ... lines
" i ... maybe inline, guess " i ... maybe inline, guess
" I ... inline " I ... inline
" R ... right (comment the line right of the cursor) " R ... right (comment the line right of the cursor)
" v ... visual " v ... visual
" o ... operator " o ... operator
" C ... force comment
" U ... force uncomment (if U and C are present, U wins)
" By default, each line in range will be commented by adding the comment " By default, each line in range will be commented by adding the comment
" prefix and postfix. " prefix and postfix.
function! tcomment#Comment(beg, end, ...) function! tcomment#Comment(beg, end, ...)
@ -634,9 +663,11 @@ function! tcomment#Comment(beg, end, ...)
endif endif
" TLogVAR comment_mode " TLogVAR comment_mode
endif endif
if exists('s:temp_options') && has_key(s:temp_options, 'mode_extra') let mode_extra = s:GetTempOption('mode_extra', '')
let comment_mode = s:AddModeExtra(comment_mode, s:temp_options.mode_extra, lbeg, lend) " TLogVAR mode_extra
" TLogVAR comment_mode if !empty(mode_extra)
let comment_mode = s:AddModeExtra(comment_mode, mode_extra, lbeg, lend)
" TLogVAR "mode_extra", comment_mode
unlet s:temp_options.mode_extra unlet s:temp_options.mode_extra
endif endif
" get the correct commentstring " get the correct commentstring
@ -698,10 +729,10 @@ function! tcomment#Comment(beg, end, ...)
" echom "DBG" string(a:000) " echom "DBG" string(a:000)
let cms0 = s:BlockGetCommentRx(cdef) let cms0 = s:BlockGetCommentRx(cdef)
" TLogVAR cms0 " TLogVAR cms0
" make whitespace optional; this conflicts with comments that require some "" make whitespace optional; this conflicts with comments that require some
" whitespace "" whitespace
let cmt_check = substitute(cms0, '\([ ]\)', '\1\\?', 'g') let cmt_check = substitute(cms0, '\([ ]\)', '\1\\?', 'g')
" turn commentstring into a search pattern "" turn commentstring into a search pattern
" TLogVAR cmt_check " TLogVAR cmt_check
let cmt_check = printf(cmt_check, '\(\_.\{-}\)') let cmt_check = printf(cmt_check, '\(\_.\{-}\)')
" TLogVAR cdef, cmt_check " TLogVAR cdef, cmt_check
@ -712,9 +743,12 @@ function! tcomment#Comment(beg, end, ...)
" echom "DBG" string(s:cdef) " echom "DBG" string(s:cdef)
let cbeg = get(s:cdef, 'col', cbeg) let cbeg = get(s:cdef, 'col', cbeg)
" TLogVAR cbeg " TLogVAR cbeg
if comment_anyway if mode_extra =~# 'U'
let uncomment = 1
elseif mode_extra =~# 'C' || comment_anyway
let uncomment = 0 let uncomment = 0
endif endif
" TLogVAR comment_anyway, mode_extra, uncomment
" go " go
" TLogVAR comment_mode " TLogVAR comment_mode
if comment_mode =~# 'B' if comment_mode =~# 'B'
@ -805,6 +839,15 @@ else
endif endif
function! s:GetTempOption(name, default) "{{{3
if exists('s:temp_options') && has_key(s:temp_options, a:name)
return s:temp_options[a:name]
else
return a:default
endif
endf
function! tcomment#SetOption(name, arg) "{{{3 function! tcomment#SetOption(name, arg) "{{{3
" TLogVAR a:name, a:arg " TLogVAR a:name, a:arg
if !exists('s:temp_options') if !exists('s:temp_options')
@ -1063,7 +1106,7 @@ endf
function! tcomment#OperatorLine(type) "{{{3 function! tcomment#OperatorLine(type) "{{{3
" TLogVAR a:type " TLogVAR a:type
call tcomment#Operator('line', 'G') call tcomment#Operator('line', 'L')
endf endf
@ -1075,7 +1118,7 @@ endf
function! tcomment#OperatorLineAnyway(type) "{{{3 function! tcomment#OperatorLineAnyway(type) "{{{3
" TLogVAR a:type " TLogVAR a:type
call tcomment#Operator('line', 'G', '!') call tcomment#Operator('line', 'L', '!')
endf endf
@ -1235,12 +1278,12 @@ function! s:StartPosRx(comment_mode, line, col)
endf endf
function! s:EndPosRx(comment_mode, line, col) function! s:EndPosRx(comment_mode, lnum, col)
" TLogVAR a:comment_mode, a:line, a:col " TLogVAR a:comment_mode, a:lnum, a:col
" if a:comment_mode =~# 'I' " if a:comment_mode =~# 'I'
" return s:EndLineRx(a:line) . s:EndColRx(a:col) " return s:EndLineRx(a:lnum) . s:EndColRx(a:col)
" else " else
return s:EndColRx(a:comment_mode, a:col) return s:EndColRx(a:comment_mode, a:lnum, a:col)
" endif " endif
endf endf
@ -1276,9 +1319,12 @@ function! s:StartColRx(comment_mode, col, ...)
endf endf
function! s:EndColRx(comment_mode, pos) function! s:EndColRx(comment_mode, lnum, pos)
" TLogVAR a:comment_mode, a:pos " TLogVAR a:comment_mode, a:lnum, a:pos
if a:pos == 0 let line = getline(a:lnum)
let cend = s:Strdisplaywidth(line)
" TLogVAR cend
if a:pos == 0 || a:pos >= cend
return '\$' return '\$'
else else
if a:comment_mode =~? 'i' && a:comment_mode =~# 'o' if a:comment_mode =~? 'i' && a:comment_mode =~# 'o'
@ -1302,7 +1348,7 @@ function! s:CommentDef(beg, end, checkRx, comment_mode, cbeg, cend)
else else
let mdrx = '\V'. s:StartColRx(a:comment_mode, a:cbeg) .'\s\*' let mdrx = '\V'. s:StartColRx(a:comment_mode, a:cbeg) .'\s\*'
endif endif
let mdrx .= a:checkRx .'\s\*'. s:EndColRx(a:comment_mode, 0) let mdrx .= a:checkRx .'\s\*'. s:EndColRx(a:comment_mode, a:end, 0)
" let mdrx = '\V'. s:StartPosRx(a:comment_mode, beg, a:cbeg) .'\s\*'. a:checkRx .'\s\*'. s:EndPosRx(a:comment_mode, end, 0) " let mdrx = '\V'. s:StartPosRx(a:comment_mode, beg, a:cbeg) .'\s\*'. a:checkRx .'\s\*'. s:EndPosRx(a:comment_mode, end, 0)
" TLogVAR mdrx " TLogVAR mdrx
let line = getline(beg) let line = getline(beg)
@ -1396,10 +1442,10 @@ function! s:ProcessLine(uncomment, match, checkRx, replace)
endif endif
endif endif
" TLogVAR rv " TLogVAR rv
if v:version > 702 || (v:version == 702 && has('patch407')) if g:tcomment#must_escape_expression_backslash
let rv = escape(rv, "\r")
else
let rv = escape(rv, "\\r") let rv = escape(rv, "\\r")
else
let rv = escape(rv, "\r")
endif endif
" TLogVAR rv " TLogVAR rv
" let rv = substitute(rv, '\n', '\\\n', 'g') " let rv = substitute(rv, '\n', '\\\n', 'g')
@ -1482,8 +1528,10 @@ function! s:CommentBlock(beg, end, cbeg, cend, comment_mode, uncomment, checkRx,
if a:uncomment if a:uncomment
let @t = substitute(@t, '\V\^\s\*'. a:checkRx .'\$', '\1', '') let @t = substitute(@t, '\V\^\s\*'. a:checkRx .'\$', '\1', '')
let tt = [] let tt = []
let rx = '\V'. s:StartColRx(a:comment_mode, a:cbeg) . '\zs\s\*'. mx " TODO: Correctly handle foreign comments with inconsistent
" TLogVAR rx " whitespace around mx markers
let rx = '\V'. s:StartColRx(a:comment_mode, a:cbeg) . '\zs'. mx
" TLogVAR mx1, rx
for line in split(@t, '\n') for line in split(@t, '\n')
let line1 = substitute(line, rx, '', 'g') let line1 = substitute(line, rx, '', 'g')
call add(tt, line1) call add(tt, line1)
@ -1907,7 +1955,7 @@ function! s:GuessCustomCommentString(ft, comment_mode, ...)
let default_cdef = a:0 >= 2 ? a:2 : {} let default_cdef = a:0 >= 2 ? a:2 : {}
let default_supports_comment_mode = get(default_cdef, 'comment_mode', custom_comment_mode) let default_supports_comment_mode = get(default_cdef, 'comment_mode', custom_comment_mode)
" TLogVAR default, default_supports_comment_mode " TLogVAR default, default_supports_comment_mode
if comment_mode =~# '[IB]' && !empty(custom_comment_mode) if comment_mode =~# '[ILB]' && !empty(custom_comment_mode)
let def = tcomment#GetCommentDef(custom_comment_mode) let def = tcomment#GetCommentDef(custom_comment_mode)
" TLogVAR 1, def " TLogVAR 1, def
elseif !empty(custom_comment) elseif !empty(custom_comment)

View File

@ -1,38 +1,14 @@
*fugitive.txt* A Git wrapper so awesome, it should be illegal *fugitive.txt* A Git wrapper so awesome, it should be illegal
Author: Tim Pope <vimNOSPAM@tpope.org> *fugitive-author* Author: Tim Pope <http://tpo.pe/>
License: Same terms as Vim itself (see |license|) License: Same terms as Vim itself (see |license|)
This plugin is only available if 'compatible' is not set. This plugin is only available if 'compatible' is not set.
INTRODUCTION *fugitive* INTRODUCTION *fugitive*
Install in ~/.vim, or in ~\vimfiles if you're on Windows and feeling lucky. Whenever you edit a file from a Git repository, a set of commands is defined
Vim 7.2 is recommended as it ships with syntax highlighting for many Git file that serve as a gateway to Git.
types.
If you're in a hurry to get started, here are some things to try:
In any file in your repository, run |:Gedit| HEAD. Press <CR> to jump to the
current branch. Press <CR> again to jump to the top most commit. Keep using
<CR> to explore parent commits, trees, and blobs. Use C in a tree or blob to
get back to the commit.
Edit a file in the work tree and make some changes. Use |:Gdiff| to open up
the indexed version. Use |do| and |dp| on various hunks to bring the files in
sync, or use |:Gread| to pull in all changes. Write the indexed version to
stage the file.
Run |:Gstatus| to check your repository's status. Use "-" to stage and reset
files and "p" to add/reset --patch them. Invoke |:Gcommit| to commit your
changes.
Run |:Gblame| in a work tree file to see a blame in a vertical split. Press
<CR> on any line to reopen and reblame that file as it stood in that commit.
Press o or O on any line to inspect that commit in a split or a tab.
Run |:Ggrep| to search the work tree or history. Run |:Gmove| to rename a
file. Run |:Gremove| to delete a file.
COMMANDS *fugitive-commands* COMMANDS *fugitive-commands*
@ -43,6 +19,10 @@ that are part of Git repositories).
:Git [args] Run an arbitrary git command. Similar to :!git [args] :Git [args] Run an arbitrary git command. Similar to :!git [args]
but chdir to the repository tree first. but chdir to the repository tree first.
*fugitive-:Git!*
:Git! [args] Like |:Git|, but capture the output into a temp file,
and edit that temp file.
*fugitive-:Gcd* *fugitive-:Gcd*
:Gcd [directory] |:cd| relative to the repository. :Gcd [directory] |:cd| relative to the repository.
@ -51,37 +31,87 @@ that are part of Git repositories).
*fugitive-:Gstatus* *fugitive-:Gstatus*
:Gstatus Bring up the output of git-status in the preview :Gstatus Bring up the output of git-status in the preview
window. In addition to standard motions, you can window. The following maps, which work on the cursor
use <C-N> and <C-P> to jump from filename to line file where sensible, are provided:
filename. Press C to invoke |:Gcommit|. Press D to
|:Gdiff| the file on the cursor line, or ds to g? show this help
|:Gsdiff|. Press - to stage or unstage the file on <C-N> next file
the cursor line. Press p to do so on a per hunk basis <C-P> previous file
(--patch). All of D, -, and p have a different, <CR> |:Gedit|
sensible (and hopefully intuitive) behavior when - |:Git| add
invoked on a heading rather than a file name. - |:Git| reset (staged files)
cA |:Gcommit| --amend --reuse-message=HEAD
ca |:Gcommit| --amend
cc |:Gcommit|
cva |:Gcommit| --amend --verbose
cvc |:Gcommit| --verbose
D |:Gdiff|
ds |:Gsdiff|
dp |:Git!| diff (p for patch; use :Gw to apply)
dp |:Git| add --intent-to-add (untracked files)
dv |:Gvdiff|
O |:Gtabedit|
o |:Gsplit|
p |:Git| add --patch
p |:Git| reset --patch (staged files)
q close status
r reload status
S |:Gvsplit|
*fugitive-:Gcommit* *fugitive-:Gcommit*
:Gcommit [args] A wrapper around git-commit. If there is nothing :Gcommit [args] A wrapper around git-commit. If there is nothing
to commit, |:Gstatus| is called instead. Unless the to commit, |:Gstatus| is called instead. Unless the
arguments given would skip the invocation of an editor arguments given would skip the invocation of an editor
(e.g., -m), a split window will be used to obtain a (e.g., -m), a split window will be used to obtain a
commit message. Write and close that window (:wq or commit message, or a new tab if -v is given. Write
|:Gwrite|) to finish the commit. Unlike when running and close that window (:wq or |:Gwrite|) to finish the
the actual git-commit command, it is possible (but commit. Unlike when running the actual git-commit
unadvisable) to muck with the index with commands like command, it is possible (but unadvisable) to alter the
git-add and git-reset while a commit message is index with commands like git-add and git-reset while a
pending. commit message is pending.
*fugitive-:Gmerge*
:Gmerge [args] Calls git-merge and loads errors and conflicted files
into the quickfix list. Opens a |:Gcommit| style
split window for the commit message if the merge
succeeds. If called during a merge conflict, the
conflicted files from the current index are loaded
into the quickfix list.
*fugitive-:Gpull*
:Gpull [args] Like |:Gmerge|, but for git-pull.
*fugitive-:Gpush*
:Gpush [args] Invoke git-push, load the results into the quickfix
list, and invoke |:cwindow| to reveal any errors.
|:Dispatch| is used if available for asynchronous
invocation.
*fugitive-:Gfetch*
:Gfetch [args] Like |:Gpush|, but for git-fetch.
*fugitive-:Ggrep* *fugitive-:Ggrep*
:Ggrep [args] |:grep| with git-grep as 'grepprg'. :Ggrep [args] |:grep| with git-grep as 'grepprg'.
*fugitive-:Glgrep*
:Glgrep [args] |:lgrep| with git-grep as 'grepprg'.
*fugitive-:Glog* *fugitive-:Glog*
:Glog [args] Load all previous revisions of the current file into :Glog [args] Load all previous revisions of the current file into
the quickfix list. Additional git-log arguments can the quickfix list. Additional git-log arguments can
be given (for example, --reverse). If "--" appears as be given (for example, --reverse). If "--" appears as
an argument, no file specific filtering is done, and an argument, no file specific filtering is done, and
commits are loaded into the quickfix list. previous commits rather than previous file revisions
are loaded.
:{range}Glog [args] Use git-log -L to load previous revisions of the given
range of the current file into the quickfix list. The
cursor is positioned on the first line of the first
diff hunk for each commit.
*fugitive-:Gllog*
:Gllog [args] Like |:Glog|, but use the location list instead of the
quickfix list.
*fugitive-:Gedit* *fugitive-:Ge* *fugitive-:Gedit* *fugitive-:Ge*
:Gedit [revision] |:edit| a |fugitive-revision|. :Gedit [revision] |:edit| a |fugitive-revision|.
@ -93,10 +123,15 @@ that are part of Git repositories).
:Gvsplit [revision] |:vsplit| a |fugitive-revision|. :Gvsplit [revision] |:vsplit| a |fugitive-revision|.
*fugitive-:Gtabedit* *fugitive-:Gtabedit*
:Gtabedit [revision] |:tabedit| a |fugitive-revision| :Gtabedit [revision] |:tabedit| a |fugitive-revision|.
*fugitive-:Gpedit* *fugitive-:Gpedit*
:Gpedit [revision] |:pedit| a |fugitive-revision| :Gpedit [revision] |:pedit| a |fugitive-revision|.
:Gsplit! [args] *fugitive-:Gsplit!* *fugitive-:Gvsplit!*
:Gvsplit! [args] *fugitive-:Gtabedit!* *fugitive-:Gpedit!*
:Gtabedit! [args] Like |:Git!|, but open the resulting temp file in a
:Gpedit! [args] split, tab, or preview window.
*fugitive-:Gread* *fugitive-:Gread*
:Gread [revision] Empty the buffer and |:read| a |fugitive-revision|. :Gread [revision] Empty the buffer and |:read| a |fugitive-revision|.
@ -107,7 +142,13 @@ that are part of Git repositories).
:{range}Gread [revision] :{range}Gread [revision]
|:read| in a |fugitive-revision| after {range}. |:read| in a |fugitive-revision| after {range}.
*fugitive-:Gwrite* *fugitive-:Gread!*
:Gread! [args] Empty the buffer and |:read| the output of a Git
command. For example, :Gread! show HEAD:%.
:{range}Gread! [args] |:read| the output of a Git command after {range}.
*fugitive-:Gw* *fugitive-:Gwrite*
:Gwrite Write to the current file's path and stage the results. :Gwrite Write to the current file's path and stage the results.
When run in a work tree file, it is effectively git When run in a work tree file, it is effectively git
add. Elsewhere, it is effectively git-checkout. A add. Elsewhere, it is effectively git-checkout. A
@ -133,14 +174,16 @@ that are part of Git repositories).
index is used (which means a three-way diff during a index is used (which means a three-way diff during a
merge conflict, making it a git-mergetool merge conflict, making it a git-mergetool
alternative). The newer of the two files is placed alternative). The newer of the two files is placed
to the right. Use |do| and |dp| and write to the to the right or bottom, depending on 'diffopt' and
index file to simulate "git add --patch". the width of the window relative to 'textwidth'. Use
|do| and |dp| and write to the index file to simulate
"git add --patch".
*fugitive-:Gsdiff* *fugitive-:Gsdiff*
:Gsdiff [revision] Like |:Gdiff|, but split horizontally. :Gsdiff [revision] Like |:Gdiff|, but always split horizontally.
*fugitive-:Gvdiff* *fugitive-:Gvdiff*
:Gvdiff [revision] Identical to |:Gdiff|. For symmetry with |:Gsdiff|. :Gvdiff [revision] Like |:Gdiff|, but always split vertically.
*fugitive-:Gmove* *fugitive-:Gmove*
:Gmove {destination} Wrapper around git-mv that renames the buffer :Gmove {destination} Wrapper around git-mv that renames the buffer
@ -156,10 +199,23 @@ that are part of Git repositories).
*fugitive-:Gblame* *fugitive-:Gblame*
:Gblame [flags] Run git-blame on the file and open the results in a :Gblame [flags] Run git-blame on the file and open the results in a
scroll bound vertical split. Press enter on a line to scroll bound vertical split. You can give any of
reblame the file as it was in that commit. You can ltfnsewMC as flags and they will be passed along to
give any of ltwfsMC as flags and they will be passed git-blame. The following maps, which work on the
along to git-blame. cursor line commit where sensible, are provided:
g? show this help
A resize to end of author column
C resize to end of commit column
D resize to end of date/time column
q close blame and return to blamed window
gq q, then |:Gedit| to return to work tree version
<CR> q, then open commit
o open commit in horizontal split
O open commit in new tab
- reblame at commit
~ reblame at [count]th first grandparent
P reblame at [count]th parent (like HEAD^[count])
:[range]Gblame [flags] Run git-blame on the given range. :[range]Gblame [flags] Run git-blame on the given range.
@ -172,6 +228,11 @@ that are part of Git repositories).
"git instaweb" from a terminal). If a range is given, "git instaweb" from a terminal). If a range is given,
it is appropriately appended to the URL as an anchor. it is appropriately appended to the URL as an anchor.
To use with GitHub FI, point g:fugitive_github_domains
at a list of domains:
>
let g:fugitive_github_domains = ['https://example.com']
~
:[range]Gbrowse! Like :Gbrowse, but put the URL on the clipboard rather :[range]Gbrowse! Like :Gbrowse, but put the URL on the clipboard rather
than opening it. than opening it.
@ -187,6 +248,16 @@ that are part of Git repositories).
MAPPINGS *fugitive-mappings* MAPPINGS *fugitive-mappings*
These maps are available everywhere.
*fugitive-c_CTRL-R_CTRL-G*
<C-R><C-G> On the command line, recall the path to the current
object (that is, a representation of the object
recognized by |:Gedit|).
*fugitive-y_CTRL-G*
["x]y<C-G> Yank the commit SHA and path to the current object.
These maps are available in Git objects. These maps are available in Git objects.
*fugitive-<CR>* *fugitive-<CR>*
@ -195,9 +266,16 @@ These maps are available in Git objects.
*fugitive-o* *fugitive-o*
o Jump to the revision under the cursor in a new split. o Jump to the revision under the cursor in a new split.
*fugitive-S*
S Jump to the revision under the cursor in a new
vertical split.
*fugitive-O* *fugitive-O*
O Jump to the revision under the cursor in a new tab. O Jump to the revision under the cursor in a new tab.
*fugitive--*
- Go to the tree containing the current tree or blob.
*fugitive-~* *fugitive-~*
~ Go to the current file in the [count]th first ~ Go to the current file in the [count]th first
ancestor. ancestor.
@ -208,6 +286,10 @@ P Go to the current file in the [count]th parent.
*fugitive-C* *fugitive-C*
C Go to the commit containing the current file. C Go to the commit containing the current file.
*fugitive-.*
. Start a |:| command line with the current revision
prepopulated at the end of the line.
*fugitive-a* *fugitive-a*
a Show the current tag, commit, or tree in an alternate a Show the current tag, commit, or tree in an alternate
format. format.
@ -248,6 +330,12 @@ a statusline, this one matches the default when 'ruler' is set:
> >
set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
< <
*fugitive#head(...)*
Use fugitive#head() to return the name of the current branch. If the current
HEAD is detached, fugitive#head() will return the empty string, unless the
optional argument is given, in which case the hash of the current commit will
be truncated to the given number of characters.
ABOUT *fugitive-about* ABOUT *fugitive-about*
Grab the latest version or report a bug on GitHub: Grab the latest version or report a bug on GitHub:

View File

@ -1,9 +1,12 @@
*linediff.txt* Diff two blocks of text
============================================================================== ==============================================================================
CONTENTS *linediff* *linediff-contents* CONTENTS *linediff* *linediff-contents*
Installation...........................: |linediff-installation| Installation...........................: |linediff-installation|
Usage..................................: |linediff-usage| Usage..................................: |linediff-usage|
Commands...............................: |linediff-commands| Commands...............................: |linediff-commands|
Settings...............................: |linediff-settings|
Internals..............................: |linediff-internals| Internals..............................: |linediff-internals|
Issues.................................: |linediff-issues| Issues.................................: |linediff-issues|
@ -24,7 +27,7 @@ The command is (provided you're in ~/.vim):
git submodule add git://github.com/AndrewRadev/linediff.vim.git bundle/linediff git submodule add git://github.com/AndrewRadev/linediff.vim.git bundle/linediff
< <
Another way is to simply copy all the essential directories inside the ~.vim/ Another way is to simply copy all the essential directories inside the ~/.vim
directory: plugin, autoload, doc. directory: plugin, autoload, doc.
============================================================================== ==============================================================================
@ -87,10 +90,72 @@ COMMANDS *linediff-commands*
*:LinediffReset* *:LinediffReset*
:LinediffReset Removes the signs denoting the diffed regions and deletes :LinediffReset[!] Removes the signs denoting the diffed regions and deletes
the temporary buffers, used for the diff. The original the temporary buffers, used for the diff. The original
buffers are untouched by this, which means that any updates buffers are untouched by this, which means that any updates
to them, performed by the diff process will remain. to them, performed by the diff process will remain.
Specifying ! discards unsaved changes made in the temporary
buffers.
==============================================================================
SETTINGS *linediff-settings*
*g:linediff_indent*
>
let g:linediff_indent = 1
<
Default value: 0
If this flag is set to 1, linediff will reindent the diffed sections in order
to minimize differences caused by formatting. This may change the buffers'
contents.
*g:linediff_buffer_type*
>
let g:linediff_buffer_type = 'scratch'
<
Default value: "tempfile"
This variable can have one of two values, "scratch" or "tempfile".
If it is set to "scratch", the created proxy buffer is not connected to any
file. The benefit is that the filename can then be set to be an informative
string instead of a weird temporary filename. The drawback is that you can't
run some external commands on this buffer, since there is no real backing
file.
If it is set to "tempfile" (the default), the proxy buffer is actually a
temporary file. The benefit is that you run external commands that expect an
actual file (like executing |:make|). The drawback is that the only way to
display information on the proxy is by hacking the statusline, which may cause
issues and can't work reliably on all statuslines.
*g:linediff_first_buffer_command*
*g:linediff_second_buffer_command*
>
let g:linediff_first_buffer_command = 'new'
let g:linediff_second_buffer_command = 'vertical new'
<
Default values: "tabnew" and "rightbelow vertical new", respectively.
These variables control what commands are used to open the two temporary
buffers. By default, the first one will open a blank new tab, and the second
one will split it vertically, from the right. This should ensure a pretty
sensible setup.
As an example, you can set them like so:
>
let g:linediff_first_buffer_command = 'leftabove new'
let g:linediff_second_buffer_command = 'rightbelow vertical new'
<
With this, the buffers will be positioned in a split above the current buffer,
the first one on the left, and the second one on the right.
You can control the positioning with judicious use of |:rightbelow| and
|:leftabove|. If you omit these commands, the view will simply follow your
default settings when opening new splits.
============================================================================== ==============================================================================
INTERNALS *linediff-internals* INTERNALS *linediff-internals*

View File

@ -1529,7 +1529,10 @@ ex-visincr-IYMD visincr.txt /*ex-visincr-IYMD*
fetch pi_netrw.txt /*fetch* fetch pi_netrw.txt /*fetch*
ftp pi_netrw.txt /*ftp* ftp pi_netrw.txt /*ftp*
fugitive fugitive.txt /*fugitive* fugitive fugitive.txt /*fugitive*
fugitive#head(...) fugitive.txt /*fugitive#head(...)*
fugitive#statusline() fugitive.txt /*fugitive#statusline()* fugitive#statusline() fugitive.txt /*fugitive#statusline()*
fugitive-- fugitive.txt /*fugitive--*
fugitive-. fugitive.txt /*fugitive-.*
fugitive-:Gblame fugitive.txt /*fugitive-:Gblame* fugitive-:Gblame fugitive.txt /*fugitive-:Gblame*
fugitive-:Gbrowse fugitive.txt /*fugitive-:Gbrowse* fugitive-:Gbrowse fugitive.txt /*fugitive-:Gbrowse*
fugitive-:Gcd fugitive.txt /*fugitive-:Gcd* fugitive-:Gcd fugitive.txt /*fugitive-:Gcd*
@ -1537,34 +1540,49 @@ fugitive-:Gcommit fugitive.txt /*fugitive-:Gcommit*
fugitive-:Gdiff fugitive.txt /*fugitive-:Gdiff* fugitive-:Gdiff fugitive.txt /*fugitive-:Gdiff*
fugitive-:Ge fugitive.txt /*fugitive-:Ge* fugitive-:Ge fugitive.txt /*fugitive-:Ge*
fugitive-:Gedit fugitive.txt /*fugitive-:Gedit* fugitive-:Gedit fugitive.txt /*fugitive-:Gedit*
fugitive-:Gfetch fugitive.txt /*fugitive-:Gfetch*
fugitive-:Ggrep fugitive.txt /*fugitive-:Ggrep* fugitive-:Ggrep fugitive.txt /*fugitive-:Ggrep*
fugitive-:Git fugitive.txt /*fugitive-:Git* fugitive-:Git fugitive.txt /*fugitive-:Git*
fugitive-:Git! fugitive.txt /*fugitive-:Git!*
fugitive-:Glcd fugitive.txt /*fugitive-:Glcd* fugitive-:Glcd fugitive.txt /*fugitive-:Glcd*
fugitive-:Glgrep fugitive.txt /*fugitive-:Glgrep*
fugitive-:Gllog fugitive.txt /*fugitive-:Gllog*
fugitive-:Glog fugitive.txt /*fugitive-:Glog* fugitive-:Glog fugitive.txt /*fugitive-:Glog*
fugitive-:Gmerge fugitive.txt /*fugitive-:Gmerge*
fugitive-:Gmove fugitive.txt /*fugitive-:Gmove* fugitive-:Gmove fugitive.txt /*fugitive-:Gmove*
fugitive-:Gpedit fugitive.txt /*fugitive-:Gpedit* fugitive-:Gpedit fugitive.txt /*fugitive-:Gpedit*
fugitive-:Gpedit! fugitive.txt /*fugitive-:Gpedit!*
fugitive-:Gpull fugitive.txt /*fugitive-:Gpull*
fugitive-:Gpush fugitive.txt /*fugitive-:Gpush*
fugitive-:Gread fugitive.txt /*fugitive-:Gread* fugitive-:Gread fugitive.txt /*fugitive-:Gread*
fugitive-:Gread! fugitive.txt /*fugitive-:Gread!*
fugitive-:Gremove fugitive.txt /*fugitive-:Gremove* fugitive-:Gremove fugitive.txt /*fugitive-:Gremove*
fugitive-:Gsdiff fugitive.txt /*fugitive-:Gsdiff* fugitive-:Gsdiff fugitive.txt /*fugitive-:Gsdiff*
fugitive-:Gsplit fugitive.txt /*fugitive-:Gsplit* fugitive-:Gsplit fugitive.txt /*fugitive-:Gsplit*
fugitive-:Gsplit! fugitive.txt /*fugitive-:Gsplit!*
fugitive-:Gstatus fugitive.txt /*fugitive-:Gstatus* fugitive-:Gstatus fugitive.txt /*fugitive-:Gstatus*
fugitive-:Gtabedit fugitive.txt /*fugitive-:Gtabedit* fugitive-:Gtabedit fugitive.txt /*fugitive-:Gtabedit*
fugitive-:Gtabedit! fugitive.txt /*fugitive-:Gtabedit!*
fugitive-:Gvdiff fugitive.txt /*fugitive-:Gvdiff* fugitive-:Gvdiff fugitive.txt /*fugitive-:Gvdiff*
fugitive-:Gvsplit fugitive.txt /*fugitive-:Gvsplit* fugitive-:Gvsplit fugitive.txt /*fugitive-:Gvsplit*
fugitive-:Gvsplit! fugitive.txt /*fugitive-:Gvsplit!*
fugitive-:Gw fugitive.txt /*fugitive-:Gw*
fugitive-:Gwq fugitive.txt /*fugitive-:Gwq* fugitive-:Gwq fugitive.txt /*fugitive-:Gwq*
fugitive-:Gwrite fugitive.txt /*fugitive-:Gwrite* fugitive-:Gwrite fugitive.txt /*fugitive-:Gwrite*
fugitive-<CR> fugitive.txt /*fugitive-<CR>* fugitive-<CR> fugitive.txt /*fugitive-<CR>*
fugitive-C fugitive.txt /*fugitive-C* fugitive-C fugitive.txt /*fugitive-C*
fugitive-O fugitive.txt /*fugitive-O* fugitive-O fugitive.txt /*fugitive-O*
fugitive-P fugitive.txt /*fugitive-P* fugitive-P fugitive.txt /*fugitive-P*
fugitive-S fugitive.txt /*fugitive-S*
fugitive-a fugitive.txt /*fugitive-a* fugitive-a fugitive.txt /*fugitive-a*
fugitive-about fugitive.txt /*fugitive-about* fugitive-about fugitive.txt /*fugitive-about*
fugitive-author fugitive.txt /*fugitive-author* fugitive-c_CTRL-R_CTRL-G fugitive.txt /*fugitive-c_CTRL-R_CTRL-G*
fugitive-commands fugitive.txt /*fugitive-commands* fugitive-commands fugitive.txt /*fugitive-commands*
fugitive-mappings fugitive.txt /*fugitive-mappings* fugitive-mappings fugitive.txt /*fugitive-mappings*
fugitive-o fugitive.txt /*fugitive-o* fugitive-o fugitive.txt /*fugitive-o*
fugitive-revision fugitive.txt /*fugitive-revision* fugitive-revision fugitive.txt /*fugitive-revision*
fugitive-statusline fugitive.txt /*fugitive-statusline* fugitive-statusline fugitive.txt /*fugitive-statusline*
fugitive-y_CTRL-G fugitive.txt /*fugitive-y_CTRL-G*
fugitive-~ fugitive.txt /*fugitive-~* fugitive-~ fugitive.txt /*fugitive-~*
fugitive.txt fugitive.txt /*fugitive.txt* fugitive.txt fugitive.txt /*fugitive.txt*
g% matchit.txt /*g%* g% matchit.txt /*g%*
@ -1577,6 +1595,10 @@ g:Netrw_corehandler pi_netrw.txt /*g:Netrw_corehandler*
g:Netrw_funcref pi_netrw.txt /*g:Netrw_funcref* g:Netrw_funcref pi_netrw.txt /*g:Netrw_funcref*
g:alignmaps_euronumber Align.txt /*g:alignmaps_euronumber* g:alignmaps_euronumber Align.txt /*g:alignmaps_euronumber*
g:alignmaps_usanumber Align.txt /*g:alignmaps_usanumber* g:alignmaps_usanumber Align.txt /*g:alignmaps_usanumber*
g:linediff_buffer_type linediff.txt /*g:linediff_buffer_type*
g:linediff_first_buffer_command linediff.txt /*g:linediff_first_buffer_command*
g:linediff_indent linediff.txt /*g:linediff_indent*
g:linediff_second_buffer_command linediff.txt /*g:linediff_second_buffer_command*
g:netrw_altfile pi_netrw.txt /*g:netrw_altfile* g:netrw_altfile pi_netrw.txt /*g:netrw_altfile*
g:netrw_alto pi_netrw.txt /*g:netrw_alto* g:netrw_alto pi_netrw.txt /*g:netrw_alto*
g:netrw_altv pi_netrw.txt /*g:netrw_altv* g:netrw_altv pi_netrw.txt /*g:netrw_altv*
@ -1662,6 +1684,7 @@ g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen*
g:tcomment#blank_lines tcomment.txt /*g:tcomment#blank_lines* g:tcomment#blank_lines tcomment.txt /*g:tcomment#blank_lines*
g:tcomment#ignore_char_type tcomment.txt /*g:tcomment#ignore_char_type* g:tcomment#ignore_char_type tcomment.txt /*g:tcomment#ignore_char_type*
g:tcomment#ignore_comment_def tcomment.txt /*g:tcomment#ignore_comment_def* g:tcomment#ignore_comment_def tcomment.txt /*g:tcomment#ignore_comment_def*
g:tcomment#must_escape_expression_backslash tcomment.txt /*g:tcomment#must_escape_expression_backslash*
g:tcomment#options_comments tcomment.txt /*g:tcomment#options_comments* g:tcomment#options_comments tcomment.txt /*g:tcomment#options_comments*
g:tcomment#options_commentstring tcomment.txt /*g:tcomment#options_commentstring* g:tcomment#options_commentstring tcomment.txt /*g:tcomment#options_commentstring*
g:tcomment#replacements_c tcomment.txt /*g:tcomment#replacements_c* g:tcomment#replacements_c tcomment.txt /*g:tcomment#replacements_c*
@ -1685,8 +1708,9 @@ g:tcommentInlineC tcomment.txt /*g:tcommentInlineC*
g:tcommentInlineXML tcomment.txt /*g:tcommentInlineXML* g:tcommentInlineXML tcomment.txt /*g:tcommentInlineXML*
g:tcommentMapLeader1 tcomment.txt /*g:tcommentMapLeader1* g:tcommentMapLeader1 tcomment.txt /*g:tcommentMapLeader1*
g:tcommentMapLeader2 tcomment.txt /*g:tcommentMapLeader2* g:tcommentMapLeader2 tcomment.txt /*g:tcommentMapLeader2*
g:tcommentMapLeaderCommentAnyway tcomment.txt /*g:tcommentMapLeaderCommentAnyway*
g:tcommentMapLeaderOp1 tcomment.txt /*g:tcommentMapLeaderOp1* g:tcommentMapLeaderOp1 tcomment.txt /*g:tcommentMapLeaderOp1*
g:tcommentMapLeaderOp2 tcomment.txt /*g:tcommentMapLeaderOp2* g:tcommentMapLeaderUncommentAnyway tcomment.txt /*g:tcommentMapLeaderUncommentAnyway*
g:tcommentMaps tcomment.txt /*g:tcommentMaps* g:tcommentMaps tcomment.txt /*g:tcommentMaps*
g:tcommentModeExtra tcomment.txt /*g:tcommentModeExtra* g:tcommentModeExtra tcomment.txt /*g:tcommentModeExtra*
g:tcommentOpModeExtra tcomment.txt /*g:tcommentOpModeExtra* g:tcommentOpModeExtra tcomment.txt /*g:tcommentOpModeExtra*
@ -1749,7 +1773,9 @@ linediff-contents linediff.txt /*linediff-contents*
linediff-installation linediff.txt /*linediff-installation* linediff-installation linediff.txt /*linediff-installation*
linediff-internals linediff.txt /*linediff-internals* linediff-internals linediff.txt /*linediff-internals*
linediff-issues linediff.txt /*linediff-issues* linediff-issues linediff.txt /*linediff-issues*
linediff-settings linediff.txt /*linediff-settings*
linediff-usage linediff.txt /*linediff-usage* linediff-usage linediff.txt /*linediff-usage*
linediff.txt linediff.txt /*linediff.txt*
local_markfilelist pi_netrw.txt /*local_markfilelist* local_markfilelist pi_netrw.txt /*local_markfilelist*
logipat LogiPat.txt /*logipat* logipat LogiPat.txt /*logipat*
logipat-arg LogiPat.txt /*logipat-arg* logipat-arg LogiPat.txt /*logipat-arg*
@ -1790,9 +1816,12 @@ matchit-troubleshoot matchit.txt /*matchit-troubleshoot*
matchit-v_% matchit.txt /*matchit-v_%* matchit-v_% matchit.txt /*matchit-v_%*
matchit.txt matchit.txt /*matchit.txt* matchit.txt matchit.txt /*matchit.txt*
matchit.vim matchit.txt /*matchit.vim* matchit.vim matchit.txt /*matchit.vim*
n_<Plug>TComment-gC tcomment.txt /*n_<Plug>TComment-gC* n_<Plug>TComment-Comment tcomment.txt /*n_<Plug>TComment-Comment*
n_<Plug>TComment-gCb tcomment.txt /*n_<Plug>TComment-gCb* n_<Plug>TComment-Commentb tcomment.txt /*n_<Plug>TComment-Commentb*
n_<Plug>TComment-gCc tcomment.txt /*n_<Plug>TComment-gCc* n_<Plug>TComment-Commentc tcomment.txt /*n_<Plug>TComment-Commentc*
n_<Plug>TComment-Uncomment tcomment.txt /*n_<Plug>TComment-Uncomment*
n_<Plug>TComment-Uncommentb tcomment.txt /*n_<Plug>TComment-Uncommentb*
n_<Plug>TComment-Uncommentc tcomment.txt /*n_<Plug>TComment-Uncommentc*
n_<Plug>TComment-gc tcomment.txt /*n_<Plug>TComment-gc* n_<Plug>TComment-gc tcomment.txt /*n_<Plug>TComment-gc*
n_<Plug>TComment-gcb tcomment.txt /*n_<Plug>TComment-gcb* n_<Plug>TComment-gcb tcomment.txt /*n_<Plug>TComment-gcb*
n_<Plug>TComment-gcc tcomment.txt /*n_<Plug>TComment-gcc* n_<Plug>TComment-gcc tcomment.txt /*n_<Plug>TComment-gcc*
@ -2100,7 +2129,8 @@ visincr-usage visincr.txt /*visincr-usage*
visincr.txt visincr.txt /*visincr.txt* visincr.txt visincr.txt /*visincr.txt*
x_<Plug>TComment-<Leader>__ tcomment.txt /*x_<Plug>TComment-<Leader>__* x_<Plug>TComment-<Leader>__ tcomment.txt /*x_<Plug>TComment-<Leader>__*
x_<Plug>TComment-<Leader>_i tcomment.txt /*x_<Plug>TComment-<Leader>_i* x_<Plug>TComment-<Leader>_i tcomment.txt /*x_<Plug>TComment-<Leader>_i*
x_<Plug>TComment-gC tcomment.txt /*x_<Plug>TComment-gC* x_<Plug>TComment-Comment tcomment.txt /*x_<Plug>TComment-Comment*
x_<Plug>TComment-Uncomment tcomment.txt /*x_<Plug>TComment-Uncomment*
x_<Plug>TComment-gc tcomment.txt /*x_<Plug>TComment-gc* x_<Plug>TComment-gc tcomment.txt /*x_<Plug>TComment-gc*
xml-plugin-callbacks xml-plugin.txt /*xml-plugin-callbacks* xml-plugin-callbacks xml-plugin.txt /*xml-plugin-callbacks*
xml-plugin-html xml-plugin.txt /*xml-plugin-html* xml-plugin-html xml-plugin.txt /*xml-plugin-html*

View File

@ -40,8 +40,16 @@ and |g:tcommentMapLeaderOp2|):
gc<Count>c{motion} :: Toggle comment text with count argument gc<Count>c{motion} :: Toggle comment text with count argument
(see |tcomment#Comment()|) (see |tcomment#Comment()|)
gcc :: Toggle comment for the current line gcc :: Toggle comment for the current line
gC{motion} :: Comment region
gCc :: Comment the current line Explicit commenting/uncommenting:
g<{motion} :: Uncomment region
g<c :: Uncomment the current line
g<b :: Uncomment the current region as block
g>{motion} :: Comment region
g>c :: Comment the current line
g>b :: Comment the current region as block
In visual mode: In visual mode:
@ -124,100 +132,106 @@ please make sure, you have the current version of vimball (vimscript
======================================================================== ========================================================================
Contents~ Contents~
g:tcommentMaps ...................... |g:tcommentMaps| g:tcommentMaps ................................ |g:tcommentMaps|
g:tcommentMapLeader1 ................ |g:tcommentMapLeader1| g:tcommentMapLeader1 .......................... |g:tcommentMapLeader1|
g:tcommentMapLeader2 ................ |g:tcommentMapLeader2| g:tcommentMapLeader2 .......................... |g:tcommentMapLeader2|
g:tcommentMapLeaderOp1 .............. |g:tcommentMapLeaderOp1| g:tcommentMapLeaderOp1 ........................ |g:tcommentMapLeaderOp1|
g:tcommentMapLeaderOp2 .............. |g:tcommentMapLeaderOp2| g:tcommentMapLeaderUncommentAnyway ............ |g:tcommentMapLeaderUncommentAnyway|
g:tcommentTextObjectInlineComment ... |g:tcommentTextObjectInlineComment| g:tcommentMapLeaderCommentAnyway .............. |g:tcommentMapLeaderCommentAnyway|
:TComment ........................... |:TComment| g:tcommentTextObjectInlineComment ............. |g:tcommentTextObjectInlineComment|
:TCommentAs ......................... |:TCommentAs| :TComment ..................................... |:TComment|
:TCommentRight ...................... |:TCommentRight| :TCommentAs ................................... |:TCommentAs|
:TCommentBlock ...................... |:TCommentBlock| :TCommentRight ................................ |:TCommentRight|
:TCommentInline ..................... |:TCommentInline| :TCommentBlock ................................ |:TCommentBlock|
:TCommentMaybeInline ................ |:TCommentMaybeInline| :TCommentInline ............................... |:TCommentInline|
<Plug>TComment-<c-_><c-_> ........... |<Plug>TComment-<c-_><c-_>| :TCommentMaybeInline .......................... |:TCommentMaybeInline|
v_<Plug>TComment-<c-_><c-_> ......... |v_<Plug>TComment-<c-_><c-_>| <Plug>TComment-<c-_><c-_> ..................... |<Plug>TComment-<c-_><c-_>|
i_<Plug>TComment-<c-_><c-_> ......... |i_<Plug>TComment-<c-_><c-_>| v_<Plug>TComment-<c-_><c-_> ................... |v_<Plug>TComment-<c-_><c-_>|
<Plug>TComment-<c-_>p ............... |<Plug>TComment-<c-_>p| i_<Plug>TComment-<c-_><c-_> ................... |i_<Plug>TComment-<c-_><c-_>|
i_<Plug>TComment-<c-_>p ............. |i_<Plug>TComment-<c-_>p| <Plug>TComment-<c-_>p ......................... |<Plug>TComment-<c-_>p|
<Plug>TComment-<c-_><space> ......... |<Plug>TComment-<c-_><space>| i_<Plug>TComment-<c-_>p ....................... |i_<Plug>TComment-<c-_>p|
i_<Plug>TComment-<c-_><space> ....... |i_<Plug>TComment-<c-_><space>| <Plug>TComment-<c-_><space> ................... |<Plug>TComment-<c-_><space>|
i_<Plug>TComment-<c-_>r ............. |i_<Plug>TComment-<c-_>r| i_<Plug>TComment-<c-_><space> ................. |i_<Plug>TComment-<c-_><space>|
<Plug>TComment-<c-_>r ............... |<Plug>TComment-<c-_>r| i_<Plug>TComment-<c-_>r ....................... |i_<Plug>TComment-<c-_>r|
v_<Plug>TComment-<c-_>i ............. |v_<Plug>TComment-<c-_>i| <Plug>TComment-<c-_>r ......................... |<Plug>TComment-<c-_>r|
<Plug>TComment-<c-_>i ............... |<Plug>TComment-<c-_>i| v_<Plug>TComment-<c-_>i ....................... |v_<Plug>TComment-<c-_>i|
i_<Plug>TComment-<c-_>i ............. |i_<Plug>TComment-<c-_>i| <Plug>TComment-<c-_>i ......................... |<Plug>TComment-<c-_>i|
<Plug>TComment-<c-_>b ............... |<Plug>TComment-<c-_>b| i_<Plug>TComment-<c-_>i ....................... |i_<Plug>TComment-<c-_>i|
i_<Plug>TComment-<c-_>b ............. |i_<Plug>TComment-<c-_>b| <Plug>TComment-<c-_>b ......................... |<Plug>TComment-<c-_>b|
<Plug>TComment-<c-_>a ............... |<Plug>TComment-<c-_>a| i_<Plug>TComment-<c-_>b ....................... |i_<Plug>TComment-<c-_>b|
i_<Plug>TComment-<c-_>a ............. |i_<Plug>TComment-<c-_>a| <Plug>TComment-<c-_>a ......................... |<Plug>TComment-<c-_>a|
<Plug>TComment-<c-_>n ............... |<Plug>TComment-<c-_>n| i_<Plug>TComment-<c-_>a ....................... |i_<Plug>TComment-<c-_>a|
i_<Plug>TComment-<c-_>n ............. |i_<Plug>TComment-<c-_>n| <Plug>TComment-<c-_>n ......................... |<Plug>TComment-<c-_>n|
<Plug>TComment-<c-_>s ............... |<Plug>TComment-<c-_>s| i_<Plug>TComment-<c-_>n ....................... |i_<Plug>TComment-<c-_>n|
i_<Plug>TComment-<c-_>s ............. |i_<Plug>TComment-<c-_>s| <Plug>TComment-<c-_>s ......................... |<Plug>TComment-<c-_>s|
<Plug>TComment-<c-_>cc .............. |<Plug>TComment-<c-_>cc| i_<Plug>TComment-<c-_>s ....................... |i_<Plug>TComment-<c-_>s|
<Plug>TComment-<c-_>ca .............. |<Plug>TComment-<c-_>ca| <Plug>TComment-<c-_>cc ........................ |<Plug>TComment-<c-_>cc|
<Plug>TComment-<Leader>__ ........... |<Plug>TComment-<Leader>__| <Plug>TComment-<c-_>ca ........................ |<Plug>TComment-<c-_>ca|
x_<Plug>TComment-<Leader>__ ......... |x_<Plug>TComment-<Leader>__| <Plug>TComment-<Leader>__ ..................... |<Plug>TComment-<Leader>__|
<Plug>TComment-<Leader>_p ........... |<Plug>TComment-<Leader>_p| x_<Plug>TComment-<Leader>__ ................... |x_<Plug>TComment-<Leader>__|
<Plug>TComment-<Leader>_<space> ..... |<Plug>TComment-<Leader>_<space>| <Plug>TComment-<Leader>_p ..................... |<Plug>TComment-<Leader>_p|
x_<Plug>TComment-<Leader>_i ......... |x_<Plug>TComment-<Leader>_i| <Plug>TComment-<Leader>_<space> ............... |<Plug>TComment-<Leader>_<space>|
<Plug>TComment-<Leader>_r ........... |<Plug>TComment-<Leader>_r| x_<Plug>TComment-<Leader>_i ................... |x_<Plug>TComment-<Leader>_i|
<Plug>TComment-<Leader>_b ........... |<Plug>TComment-<Leader>_b| <Plug>TComment-<Leader>_r ..................... |<Plug>TComment-<Leader>_r|
<Plug>TComment-<Leader>_a ........... |<Plug>TComment-<Leader>_a| <Plug>TComment-<Leader>_b ..................... |<Plug>TComment-<Leader>_b|
<Plug>TComment-<Leader>_n ........... |<Plug>TComment-<Leader>_n| <Plug>TComment-<Leader>_a ..................... |<Plug>TComment-<Leader>_a|
<Plug>TComment-<Leader>_s ........... |<Plug>TComment-<Leader>_s| <Plug>TComment-<Leader>_n ..................... |<Plug>TComment-<Leader>_n|
n_<Plug>TComment-gC ................. |n_<Plug>TComment-gC| <Plug>TComment-<Leader>_s ..................... |<Plug>TComment-<Leader>_s|
n_<Plug>TComment-gCc ................ |n_<Plug>TComment-gCc| n_<Plug>TComment-Uncomment .................... |n_<Plug>TComment-Uncomment|
n_<Plug>TComment-gCb ................ |n_<Plug>TComment-gCb| n_<Plug>TComment-Uncommentc ................... |n_<Plug>TComment-Uncommentc|
x_<Plug>TComment-gC ................. |x_<Plug>TComment-gC| n_<Plug>TComment-Uncommentb ................... |n_<Plug>TComment-Uncommentb|
v_<Plug>TComment-ic ................. |v_<Plug>TComment-ic| x_<Plug>TComment-Uncomment .................... |x_<Plug>TComment-Uncomment|
<Plug>TComment-ic ................... |<Plug>TComment-ic| n_<Plug>TComment-Comment ...................... |n_<Plug>TComment-Comment|
n_<Plug>TComment-gcc ................ |n_<Plug>TComment-gcc| n_<Plug>TComment-Commentc ..................... |n_<Plug>TComment-Commentc|
n_<Plug>TComment-gcb ................ |n_<Plug>TComment-gcb| n_<Plug>TComment-Commentb ..................... |n_<Plug>TComment-Commentb|
x_<Plug>TComment-gc ................. |x_<Plug>TComment-gc| x_<Plug>TComment-Comment ...................... |x_<Plug>TComment-Comment|
n_<Plug>TComment-gc ................. |n_<Plug>TComment-gc| v_<Plug>TComment-ic ........................... |v_<Plug>TComment-ic|
g:tcomment#blank_lines .............. |g:tcomment#blank_lines| <Plug>TComment-ic ............................. |<Plug>TComment-ic|
g:tcomment#rstrip_on_uncomment ...... |g:tcomment#rstrip_on_uncomment| n_<Plug>TComment-gcc .......................... |n_<Plug>TComment-gcc|
g:tcommentModeExtra ................. |g:tcommentModeExtra| n_<Plug>TComment-gcb .......................... |n_<Plug>TComment-gcb|
g:tcommentOpModeExtra ............... |g:tcommentOpModeExtra| x_<Plug>TComment-gc ........................... |x_<Plug>TComment-gc|
g:tcommentOptions ................... |g:tcommentOptions| n_<Plug>TComment-gc ........................... |n_<Plug>TComment-gc|
g:tcomment#options_comments ......... |g:tcomment#options_comments| g:tcomment#blank_lines ........................ |g:tcomment#blank_lines|
g:tcomment#options_commentstring .... |g:tcomment#options_commentstring| g:tcomment#rstrip_on_uncomment ................ |g:tcomment#rstrip_on_uncomment|
g:tcomment#ignore_char_type ......... |g:tcomment#ignore_char_type| g:tcommentModeExtra ........................... |g:tcommentModeExtra|
g:tcommentGuessFileType ............. |g:tcommentGuessFileType| g:tcommentOpModeExtra ......................... |g:tcommentOpModeExtra|
g:tcommentGuessFileType_dsl ......... |g:tcommentGuessFileType_dsl| g:tcommentOptions ............................. |g:tcommentOptions|
g:tcommentGuessFileType_php ......... |g:tcommentGuessFileType_php| g:tcomment#options_comments ................... |g:tcomment#options_comments|
g:tcommentGuessFileType_blade ....... |g:tcommentGuessFileType_blade| g:tcomment#options_commentstring .............. |g:tcomment#options_commentstring|
g:tcommentGuessFileType_html ........ |g:tcommentGuessFileType_html| g:tcomment#ignore_char_type ................... |g:tcomment#ignore_char_type|
g:tcommentGuessFileType_tskeleton ... |g:tcommentGuessFileType_tskeleton| g:tcommentGuessFileType ....................... |g:tcommentGuessFileType|
g:tcommentGuessFileType_vim ......... |g:tcommentGuessFileType_vim| g:tcommentGuessFileType_dsl ................... |g:tcommentGuessFileType_dsl|
g:tcommentGuessFileType_django ...... |g:tcommentGuessFileType_django| g:tcommentGuessFileType_php ................... |g:tcommentGuessFileType_php|
g:tcommentGuessFileType_eruby ....... |g:tcommentGuessFileType_eruby| g:tcommentGuessFileType_blade ................. |g:tcommentGuessFileType_blade|
g:tcommentGuessFileType_smarty ...... |g:tcommentGuessFileType_smarty| g:tcommentGuessFileType_html .................. |g:tcommentGuessFileType_html|
g:tcommentIgnoreTypes_php ........... |g:tcommentIgnoreTypes_php| g:tcommentGuessFileType_tskeleton ............. |g:tcommentGuessFileType_tskeleton|
g:tcomment#syntax_substitute ........ |g:tcomment#syntax_substitute| g:tcommentGuessFileType_vim ................... |g:tcommentGuessFileType_vim|
g:tcommentSyntaxMap ................. |g:tcommentSyntaxMap| g:tcommentGuessFileType_django ................ |g:tcommentGuessFileType_django|
g:tcomment#replacements_c ........... |g:tcomment#replacements_c| g:tcommentGuessFileType_eruby ................. |g:tcommentGuessFileType_eruby|
g:tcommentInlineC ................... |g:tcommentInlineC| g:tcommentGuessFileType_smarty ................ |g:tcommentGuessFileType_smarty|
g:tcommentBlockC2 ................... |g:tcommentBlockC2| g:tcommentIgnoreTypes_php ..................... |g:tcommentIgnoreTypes_php|
g:tcomment#replacements_xml ......... |g:tcomment#replacements_xml| g:tcomment#syntax_substitute .................. |g:tcomment#syntax_substitute|
g:tcommentBlockXML .................. |g:tcommentBlockXML| g:tcommentSyntaxMap ........................... |g:tcommentSyntaxMap|
g:tcommentInlineXML ................. |g:tcommentInlineXML| g:tcomment#replacements_c ..................... |g:tcomment#replacements_c|
g:tcomment#ignore_comment_def ....... |g:tcomment#ignore_comment_def| g:tcommentInlineC ............................. |g:tcommentInlineC|
tcomment#DefineType ................. |tcomment#DefineType()| g:tcommentBlockC2 ............................. |g:tcommentBlockC2|
tcomment#GetCommentDef .............. |tcomment#GetCommentDef()| g:tcomment#replacements_xml ................... |g:tcomment#replacements_xml|
g:tcomment_types .................... |g:tcomment_types| g:tcommentBlockXML ............................ |g:tcommentBlockXML|
tcomment#Comment .................... |tcomment#Comment()| g:tcommentInlineXML ........................... |g:tcommentInlineXML|
tcomment#SetOption .................. |tcomment#SetOption()| g:tcomment#ignore_comment_def ................. |g:tcomment#ignore_comment_def|
tcomment#Operator ................... |tcomment#Operator()| g:tcomment#must_escape_expression_backslash ... |g:tcomment#must_escape_expression_backslash|
tcomment#OperatorLine ............... |tcomment#OperatorLine()| tcomment#DefineType ........................... |tcomment#DefineType()|
tcomment#OperatorAnyway ............. |tcomment#OperatorAnyway()| tcomment#GetCommentDef ........................ |tcomment#GetCommentDef()|
tcomment#OperatorLineAnyway ......... |tcomment#OperatorLineAnyway()| g:tcomment_types .............................. |g:tcomment_types|
tcomment#CommentAs .................. |tcomment#CommentAs()| tcomment#Comment .............................. |tcomment#Comment()|
tcomment#GuessCommentType ........... |tcomment#GuessCommentType()| tcomment#SetOption ............................ |tcomment#SetOption()|
tcomment#TextObjectInlineComment .... |tcomment#TextObjectInlineComment()| tcomment#Operator ............................. |tcomment#Operator()|
tcomment#OperatorLine ......................... |tcomment#OperatorLine()|
tcomment#OperatorAnyway ....................... |tcomment#OperatorAnyway()|
tcomment#OperatorLineAnyway ................... |tcomment#OperatorLineAnyway()|
tcomment#CommentAs ............................ |tcomment#CommentAs()|
tcomment#GuessCommentType ..................... |tcomment#GuessCommentType()|
tcomment#TextObjectInlineComment .............. |tcomment#TextObjectInlineComment()|
======================================================================== ========================================================================
@ -241,8 +255,12 @@ g:tcommentMapLeader2 (default: '<Leader>_')
g:tcommentMapLeaderOp1 (default: 'gc') g:tcommentMapLeaderOp1 (default: 'gc')
See |tcomment-operator|. See |tcomment-operator|.
*g:tcommentMapLeaderOp2* *g:tcommentMapLeaderUncommentAnyway*
g:tcommentMapLeaderOp2 (default: 'gC') g:tcommentMapLeaderUncommentAnyway (default: 'g<')
See |tcomment-operator|.
*g:tcommentMapLeaderCommentAnyway*
g:tcommentMapLeaderCommentAnyway (default: 'g>')
See |tcomment-operator|. See |tcomment-operator|.
*g:tcommentTextObjectInlineComment* *g:tcommentTextObjectInlineComment*
@ -402,17 +420,29 @@ x_<Plug>TComment-<Leader>_i ... :TCommentInline<cr>
*<Plug>TComment-<Leader>_s* *<Plug>TComment-<Leader>_s*
<Plug>TComment-<Leader>_s ... :TCommentAs <c-r>=&ft<cr>_ <Plug>TComment-<Leader>_s ... :TCommentAs <c-r>=&ft<cr>_
*n_<Plug>TComment-gC* *n_<Plug>TComment-Uncomment*
n_<Plug>TComment-gC ... :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorAnyway<cr>g@ n_<Plug>TComment-Uncomment ... :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| call tcomment#SetOption("mode_extra", "U") \| let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorAnyway<cr>g@
*n_<Plug>TComment-gCc* *n_<Plug>TComment-Uncommentc*
n_<Plug>TComment-gCc ... :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLineAnyway<cr>g@$ n_<Plug>TComment-Uncommentc ... :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| call tcomment#SetOption("mode_extra", "U") \| let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLineAnyway<cr>g@$
*n_<Plug>TComment-gCb* *n_<Plug>TComment-Uncommentb*
n_<Plug>TComment-gCb ... :let w:tcommentPos = getpos(".") \| call tcomment#SetOption("mode_extra", "B") \| set opfunc=tcomment#OperatorLine<cr>g@ n_<Plug>TComment-Uncommentb ... :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| call tcomment#SetOption("mode_extra", "UB") \| let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLine<cr>g@
*x_<Plug>TComment-gC* *x_<Plug>TComment-Uncomment*
x_<Plug>TComment-gC ... :TCommentMaybeInline!<cr> x_<Plug>TComment-Uncomment ... :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| call tcomment#SetOption("mode_extra", "U") \| '<,'>TCommentMaybeInline<cr>
*n_<Plug>TComment-Comment*
n_<Plug>TComment-Comment ... :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorAnyway<cr>g@
*n_<Plug>TComment-Commentc*
n_<Plug>TComment-Commentc ... :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLineAnyway<cr>g@$
*n_<Plug>TComment-Commentb*
n_<Plug>TComment-Commentb ... :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| call tcomment#SetOption("mode_extra", "B") \| let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLine<cr>g@
*x_<Plug>TComment-Comment*
x_<Plug>TComment-Comment ... :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| '<,'>TCommentMaybeInline!<cr>
*v_<Plug>TComment-ic* *v_<Plug>TComment-ic*
v_<Plug>TComment-ic ... :<c-U>call tcomment#TextObjectInlineComment()<cr> v_<Plug>TComment-ic ... :<c-U>call tcomment#TextObjectInlineComment()<cr>
@ -473,12 +503,14 @@ g:tcommentOptions (default: {})
< <
*g:tcomment#options_comments* *g:tcomment#options_comments*
g:tcomment#options_comments (default: {'whitespace': 'both'}) g:tcomment#options_comments (default: {'whitespace': get(g:tcommentOptions, 'whitespace', 'both')})
Options when using a the 'comments' option. Additional args for |tcomment#Comment()| when using the 'comments'
option.
*g:tcomment#options_commentstring* *g:tcomment#options_commentstring*
g:tcomment#options_commentstring (default: {'whitespace': 'both'}) g:tcomment#options_commentstring (default: {'whitespace': get(g:tcommentOptions, 'whitespace', 'both')})
Options when using a the 'commentstring' option. Additional args for |tcomment#Comment()| when using the
'commentstring' option.
*g:tcomment#ignore_char_type* *g:tcomment#ignore_char_type*
g:tcomment#ignore_char_type (default: 1) g:tcomment#ignore_char_type (default: 1)
@ -582,6 +614,20 @@ g:tcomment#ignore_comment_def (default: [])
This variable should be set before loading autoload/tcomment.vim. This variable should be set before loading autoload/tcomment.vim.
*g:tcomment#must_escape_expression_backslash*
g:tcomment#must_escape_expression_backslash (default: 0)
Users of vim earlier than 7.3 might have to set this variable to
true. Set this variable to 0, if you see unexpected "\r" char
sequences in comments.
The reommended value was `!(v:version > 702 || (v:version == 702 && has('patch407')))`.
It is now assumed though, that no unpatched versions of vim are in
use.
References:
Patch 7.2.407 when using :s with an expression backslashes are dropped
https://github.com/tomtom/tcomment_vim/issues/102
*tcomment#DefineType()* *tcomment#DefineType()*
tcomment#DefineType(name, commentdef, ?cdef={}, ?anyway=0) tcomment#DefineType(name, commentdef, ?cdef={}, ?anyway=0)
If you don't explicitly define a comment style, |:TComment| will use If you don't explicitly define a comment style, |:TComment| will use
@ -670,11 +716,14 @@ tcomment#Comment(beg, end, ...)
comment_mode (see also ¦g:tcommentModeExtra¦): comment_mode (see also ¦g:tcommentModeExtra¦):
G ... guess the value of comment_mode G ... guess the value of comment_mode
B ... block (use extra lines for the comment markers) B ... block (use extra lines for the comment markers)
L ... lines
i ... maybe inline, guess i ... maybe inline, guess
I ... inline I ... inline
R ... right (comment the line right of the cursor) R ... right (comment the line right of the cursor)
v ... visual v ... visual
o ... operator o ... operator
C ... force comment
U ... force uncomment (if U and C are present, U wins)
By default, each line in range will be commented by adding the comment By default, each line in range will be commented by adding the comment
prefix and postfix. prefix and postfix.
@ -724,4 +773,4 @@ tcomment#TextObjectInlineComment()
vim:tw=78:fo=tcq2:isk=!-~,^*,^|,^":ts=8:ft=help:norl: vim:tw=78:fo=w2croql:isk=!-~,^*,^|,^":ts=8:ft=help:norl:

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,32 @@
if exists("g:loaded_linediff") || &cp if exists('g:loaded_linediff') || &cp
finish finish
endif endif
let g:loaded_linediff = '0.1.1' " version number let g:loaded_linediff = '0.2.0' " version number
let s:keepcpo = &cpo let s:keepcpo = &cpo
set cpo&vim set cpo&vim
if !exists('g:linediff_indent')
let g:linediff_indent = 0
endif
if !exists('g:linediff_buffer_type')
" One of: 'tempfile', 'scratch'
let g:linediff_buffer_type = 'tempfile'
endif
if !exists('g:linediff_first_buffer_command')
let g:linediff_first_buffer_command = 'tabnew'
endif
if !exists('g:linediff_second_buffer_command')
let g:linediff_second_buffer_command = 'rightbelow vertical new'
endif
" Initialized lazily to avoid executing the autoload file before it's really " Initialized lazily to avoid executing the autoload file before it's really
" needed. " needed.
function! s:Init() function! s:Init()
if !exists('s:differ_one') if !s:IsInitialized()
let s:differ_one = linediff#differ#New('linediff_one', 1) let s:differ_one = linediff#differ#New('linediff_one', 1)
let s:differ_two = linediff#differ#New('linediff_two', 2) let s:differ_two = linediff#differ#New('linediff_two', 2)
endif endif
@ -24,25 +41,46 @@ function! s:Linediff(from, to)
elseif s:differ_two.IsBlank() elseif s:differ_two.IsBlank()
call s:differ_two.Init(a:from, a:to) call s:differ_two.Init(a:from, a:to)
call s:PerformDiff(s:differ_one, s:differ_two) call s:PerformDiff()
else else
call s:differ_one.Reset() call s:LinediffReset('!')
call s:differ_two.Reset()
call s:Linediff(a:from, a:to) call s:Linediff(a:from, a:to)
endif endif
endfunction endfunction
command! LinediffReset call s:LinediffReset() command! -bang LinediffReset call s:LinediffReset(<q-bang>)
function! s:LinediffReset() function! s:LinediffReset(bang)
call s:differ_one.Reset() if s:IsInitialized()
call s:differ_two.Reset() let force = a:bang == '!'
call s:differ_one.CloseAndReset(force)
call s:differ_two.CloseAndReset(force)
endif
endfunction endfunction
function! s:PerformDiff(one, two) " Checks whether plugin is initialized.
call a:one.CreateDiffBuffer("tabedit") function! s:IsInitialized()
call a:two.CreateDiffBuffer("rightbelow vsplit") return exists('s:differ_one')
let a:one.other_differ = a:two
let a:two.other_differ = a:one
endfunction endfunction
" The closing logic is a bit roundabout, since changing a buffer in a
" BufUnload autocommand doesn't seem to work.
"
" The process is: if a window is entered after the other differ was destroyed,
" destroy this one as well and close the window.
"
function! s:PerformDiff()
call s:differ_one.CreateDiffBuffer(g:linediff_first_buffer_command)
autocmd BufUnload <buffer> silent call s:differ_one.Reset()
autocmd WinEnter <buffer> if s:differ_two.IsBlank() | silent call s:differ_one.CloseAndReset(0) | endif
call s:differ_two.CreateDiffBuffer(g:linediff_second_buffer_command)
autocmd BufUnload <buffer> silent call s:differ_two.Reset()
autocmd WinEnter <buffer> if s:differ_one.IsBlank() | silent call s:differ_two.CloseAndReset(0) | endif
wincmd t " move to the first diff buffer
let s:differ_one.other_differ = s:differ_two
let s:differ_two.other_differ = s:differ_one
endfunction
let &cpo = s:keepcpo

View File

@ -2,14 +2,14 @@
" @Author: Tom Link (micathom AT gmail com) " @Author: Tom Link (micathom AT gmail com)
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 27-Dez-2004. " @Created: 27-Dez-2004.
" @Last Change: 2014-02-05. " @Last Change: 2014-06-30.
" @Revision: 811 " @Revision: 840
" GetLatestVimScripts: 1173 1 tcomment.vim " GetLatestVimScripts: 1173 1 tcomment.vim
if &cp || exists('loaded_tcomment') if &cp || exists('loaded_tcomment')
finish finish
endif endif
let loaded_tcomment = 303 let loaded_tcomment = 304
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
@ -37,9 +37,14 @@ if !exists("g:tcommentMapLeaderOp1")
let g:tcommentMapLeaderOp1 = 'gc' "{{{2 let g:tcommentMapLeaderOp1 = 'gc' "{{{2
endif endif
if !exists("g:tcommentMapLeaderOp2") if !exists("g:tcommentMapLeaderUncommentAnyway")
" See |tcomment-operator|. " See |tcomment-operator|.
let g:tcommentMapLeaderOp2 = 'gC' "{{{2 let g:tcommentMapLeaderUncommentAnyway = 'g<' "{{{2
endif
if !exists("g:tcommentMapLeaderCommentAnyway")
" See |tcomment-operator|.
let g:tcommentMapLeaderCommentAnyway = 'g>' "{{{2
endif endif
if !exists('g:tcommentTextObjectInlineComment') if !exists('g:tcommentTextObjectInlineComment')
@ -56,7 +61,7 @@ endif
" ARGS... are either (see also |tcomment#Comment()|): " ARGS... are either (see also |tcomment#Comment()|):
" 1. a list of key=value pairs " 1. a list of key=value pairs
" 2. 1-2 values for: ?commentBegin, ?commentEnd " 2. 1-2 values for: ?commentBegin, ?commentEnd
command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TComment command! -bar -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TComment
\ keepjumps call tcomment#Comment(<line1>, <line2>, 'G', "<bang>", <f-args>) \ keepjumps call tcomment#Comment(<line1>, <line2>, 'G', "<bang>", <f-args>)
" :display: :[range]TCommentAs[!] commenttype ?ARGS... " :display: :[range]TCommentAs[!] commenttype ?ARGS...
@ -66,7 +71,7 @@ command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TComme
" ARGS... are either (see also |tcomment#Comment()|): " ARGS... are either (see also |tcomment#Comment()|):
" 1. a list of key=value pairs " 1. a list of key=value pairs
" 2. 1-2 values for: ?commentBegin, ?commentEnd " 2. 1-2 values for: ?commentBegin, ?commentEnd
command! -bang -complete=customlist,tcomment#Complete -range -nargs=+ TCommentAs command! -bar -bang -complete=customlist,tcomment#Complete -range -nargs=+ TCommentAs
\ call tcomment#CommentAs(<line1>, <line2>, "<bang>", <f-args>) \ call tcomment#CommentAs(<line1>, <line2>, "<bang>", <f-args>)
" :display: :[range]TCommentRight[!] ?ARGS... " :display: :[range]TCommentRight[!] ?ARGS...
@ -78,7 +83,7 @@ command! -bang -complete=customlist,tcomment#Complete -range -nargs=+ TCommentAs
" ARGS... are either (see also |tcomment#Comment()|): " ARGS... are either (see also |tcomment#Comment()|):
" 1. a list of key=value pairs " 1. a list of key=value pairs
" 2. 1-2 values for: ?commentBegin, ?commentEnd " 2. 1-2 values for: ?commentBegin, ?commentEnd
command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TCommentRight command! -bar -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TCommentRight
\ keepjumps call tcomment#Comment(<line1>, <line2>, 'R', "<bang>", <f-args>) \ keepjumps call tcomment#Comment(<line1>, <line2>, 'R', "<bang>", <f-args>)
" :display: :[range]TCommentBlock[!] ?ARGS... " :display: :[range]TCommentBlock[!] ?ARGS...
@ -89,7 +94,7 @@ command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TComme
" ARGS... are either (see also |tcomment#Comment()|): " ARGS... are either (see also |tcomment#Comment()|):
" 1. a list of key=value pairs " 1. a list of key=value pairs
" 2. 1-2 values for: ?commentBegin, ?commentEnd " 2. 1-2 values for: ?commentBegin, ?commentEnd
command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TCommentBlock command! -bar -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TCommentBlock
\ keepjumps call tcomment#Comment(<line1>, <line2>, 'B', "<bang>", <f-args>) \ keepjumps call tcomment#Comment(<line1>, <line2>, 'B', "<bang>", <f-args>)
" :display: :[range]TCommentInline[!] ?ARGS... " :display: :[range]TCommentInline[!] ?ARGS...
@ -99,7 +104,7 @@ command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TComme
" ARGS... are either (see also |tcomment#Comment()|): " ARGS... are either (see also |tcomment#Comment()|):
" 1. a list of key=value pairs " 1. a list of key=value pairs
" 2. 1-2 values for: ?commentBegin, ?commentEnd " 2. 1-2 values for: ?commentBegin, ?commentEnd
command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TCommentInline command! -bar -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TCommentInline
\ keepjumps call tcomment#Comment(<line1>, <line2>, 'I', "<bang>", <f-args>) \ keepjumps call tcomment#Comment(<line1>, <line2>, 'I', "<bang>", <f-args>)
" :display: :[range]TCommentMaybeInline[!] ?ARGS... " :display: :[range]TCommentMaybeInline[!] ?ARGS...
@ -108,7 +113,7 @@ command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TComme
" ARGS... are either (see also |tcomment#Comment()|): " ARGS... are either (see also |tcomment#Comment()|):
" 1. a list of key=value pairs " 1. a list of key=value pairs
" 2. 1-2 values for: ?commentBegin, ?commentEnd " 2. 1-2 values for: ?commentBegin, ?commentEnd
command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TCommentMaybeInline command! -bar -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TCommentMaybeInline
\ keepjumps call tcomment#Comment(<line1>, <line2>, 'i', "<bang>", <f-args>) \ keepjumps call tcomment#Comment(<line1>, <line2>, 'i', "<bang>", <f-args>)
@ -146,10 +151,15 @@ noremap <Plug>TComment-<Leader>_a :TCommentAs
noremap <Plug>TComment-<Leader>_n :TCommentAs <c-r>=&ft<cr> noremap <Plug>TComment-<Leader>_n :TCommentAs <c-r>=&ft<cr>
noremap <Plug>TComment-<Leader>_s :TCommentAs <c-r>=&ft<cr>_ noremap <Plug>TComment-<Leader>_s :TCommentAs <c-r>=&ft<cr>_
nnoremap <silent> <Plug>TComment-gC :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorAnyway<cr>g@ nnoremap <silent> <Plug>TComment-Uncomment :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| call tcomment#SetOption("mode_extra", "U") \| let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorAnyway<cr>g@
nnoremap <silent> <Plug>TComment-gCc :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLineAnyway<cr>g@$ nnoremap <silent> <Plug>TComment-Uncommentc :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| call tcomment#SetOption("mode_extra", "U") \| let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLineAnyway<cr>g@$
nnoremap <silent> <Plug>TComment-gCb :let w:tcommentPos = getpos(".") \| call tcomment#SetOption("mode_extra", "B") \| set opfunc=tcomment#OperatorLine<cr>g@ nnoremap <silent> <Plug>TComment-Uncommentb :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| call tcomment#SetOption("mode_extra", "UB") \| let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLine<cr>g@
xnoremap <Plug>TComment-gC :TCommentMaybeInline!<cr> xnoremap <silent> <Plug>TComment-Uncomment :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| call tcomment#SetOption("mode_extra", "U") \| '<,'>TCommentMaybeInline<cr>
nnoremap <silent> <Plug>TComment-Comment :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorAnyway<cr>g@
nnoremap <silent> <Plug>TComment-Commentc :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLineAnyway<cr>g@$
nnoremap <silent> <Plug>TComment-Commentb :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| call tcomment#SetOption("mode_extra", "B") \| let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLine<cr>g@
xnoremap <silent> <Plug>TComment-Comment :<c-u>if v:count > 0 \| call tcomment#SetOption("count", v:count) \| endif \| '<,'>TCommentMaybeInline!<cr>
vnoremap <Plug>TComment-ic :<c-U>call tcomment#TextObjectInlineComment()<cr> vnoremap <Plug>TComment-ic :<c-U>call tcomment#TextObjectInlineComment()<cr>
noremap <Plug>TComment-ic :<c-U>call tcomment#TextObjectInlineComment()<cr> noremap <Plug>TComment-ic :<c-U>call tcomment#TextObjectInlineComment()<cr>
@ -224,11 +234,17 @@ if g:tcommentMaps
exec 'nmap <silent> '. g:tcommentMapLeaderOp1 .'b <Plug>TComment-gcb' exec 'nmap <silent> '. g:tcommentMapLeaderOp1 .'b <Plug>TComment-gcb'
exec 'xmap '. g:tcommentMapLeaderOp1 .' <Plug>TComment-gc' exec 'xmap '. g:tcommentMapLeaderOp1 .' <Plug>TComment-gc'
endif endif
if g:tcommentMapLeaderOp2 != '' if g:tcommentMapLeaderUncommentAnyway != ''
exec 'nmap <silent> '. g:tcommentMapLeaderOp2 .' <Plug>TComment-gC' exec 'nmap <silent> '. g:tcommentMapLeaderUncommentAnyway .' <Plug>TComment-Uncomment'
exec 'nmap <silent> '. g:tcommentMapLeaderOp2 .'c <Plug>TComment-gCc' exec 'nmap <silent> '. g:tcommentMapLeaderUncommentAnyway .'c <Plug>TComment-Uncommentc'
exec 'nmap <silent> '. g:tcommentMapLeaderOp2 .'b <Plug>TComment-gCb' exec 'nmap <silent> '. g:tcommentMapLeaderUncommentAnyway .'b <Plug>TComment-Uncommentb'
exec 'xmap '. g:tcommentMapLeaderOp2 .' <Plug>TComment-gC' exec 'xmap '. g:tcommentMapLeaderUncommentAnyway .' <Plug>TComment-Uncomment'
endif
if g:tcommentMapLeaderCommentAnyway != ''
exec 'nmap <silent> '. g:tcommentMapLeaderCommentAnyway .' <Plug>TComment-Comment'
exec 'nmap <silent> '. g:tcommentMapLeaderCommentAnyway .'c <Plug>TComment-Commentc'
exec 'nmap <silent> '. g:tcommentMapLeaderCommentAnyway .'b <Plug>TComment-Commentb'
exec 'xmap '. g:tcommentMapLeaderCommentAnyway .' <Plug>TComment-Comment'
endif endif
if g:tcommentTextObjectInlineComment != '' if g:tcommentTextObjectInlineComment != ''
exec 'vmap' g:tcommentTextObjectInlineComment ' <Plug>TComment-ic' exec 'vmap' g:tcommentTextObjectInlineComment ' <Plug>TComment-ic'