GetLatestVimScripts
This commit is contained in:
parent
9f530c0a76
commit
844e12f6aa
@ -19,14 +19,14 @@ ScriptID SourceID Filename
|
||||
1046 4249 Lusty Explorer
|
||||
2043 7805 VimPdb (debugging python)
|
||||
1776 7902 Vimgrep Replace
|
||||
3745 16823 LineDiff
|
||||
3745 22834 LineDiff
|
||||
39 8196 matchit.vim
|
||||
2092 8095 reloaded.vim (matrix colorscheme)
|
||||
848 14668 SrchRplcHiGrp.vim (Search/Replace on Syntax Group)
|
||||
294 19633 Align.vim
|
||||
479 9276 MultipleSearch.vba
|
||||
1066 7618 cecutil.vim
|
||||
1173 21766 tComment.vim
|
||||
1173 22422 tComment.vim
|
||||
2701 18988 editsrec
|
||||
3280 14334 Tabbi
|
||||
642 15781 :AutoInstall: getscript.vim
|
||||
@ -35,4 +35,4 @@ ScriptID SourceID Filename
|
||||
3304 20505 Gundo
|
||||
90 19809 vcscommand
|
||||
974 4316 python.vim (indent)
|
||||
2975 15542 fugitive.vim
|
||||
2975 22815 fugitive.vim
|
||||
|
@ -16,7 +16,9 @@ function! linediff#differ#New(sign_name, sign_number)
|
||||
\ 'Init': function('linediff#differ#Init'),
|
||||
\ 'IsBlank': function('linediff#differ#IsBlank'),
|
||||
\ 'Reset': function('linediff#differ#Reset'),
|
||||
\ 'CloseAndReset': function('linediff#differ#CloseAndReset'),
|
||||
\ 'Lines': function('linediff#differ#Lines'),
|
||||
\ 'Indent': function('linediff#differ#Indent'),
|
||||
\ 'CreateDiffBuffer': function('linediff#differ#CreateDiffBuffer'),
|
||||
\ 'SetupDiffBuffer': function('linediff#differ#SetupDiffBuffer'),
|
||||
\ '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
|
||||
" make it usable again.
|
||||
function! linediff#differ#Reset() dict
|
||||
call self.CloseDiffBuffer()
|
||||
|
||||
let self.original_buffer = -1
|
||||
let self.diff_buffer = -1
|
||||
let self.filetype = ''
|
||||
@ -66,6 +66,13 @@ function! linediff#differ#Reset() dict
|
||||
let self.is_blank = 1
|
||||
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
|
||||
" list.
|
||||
function! linediff#differ#Lines() dict
|
||||
@ -75,20 +82,41 @@ endfunction
|
||||
" Creates the buffer used for the diffing and connects it to this differ
|
||||
" object.
|
||||
function! linediff#differ#CreateDiffBuffer(edit_command) dict
|
||||
let lines = self.Lines()
|
||||
let temp_file = tempname()
|
||||
let lines = self.Lines()
|
||||
|
||||
exe a:edit_command . " " . temp_file
|
||||
call append(0, lines)
|
||||
normal! Gdd
|
||||
set nomodified
|
||||
if g:linediff_buffer_type == 'tempfile'
|
||||
let temp_file = tempname()
|
||||
|
||||
silent exe a:edit_command . " " . temp_file
|
||||
call append(0, lines)
|
||||
silent $delete _
|
||||
|
||||
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('%')
|
||||
call self.SetupDiffBuffer()
|
||||
call self.Indent()
|
||||
|
||||
diffthis
|
||||
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.
|
||||
"
|
||||
" Attempts to leave the current statusline as it is, and simply add the
|
||||
@ -97,20 +125,30 @@ endfunction
|
||||
function! linediff#differ#SetupDiffBuffer() dict
|
||||
let b:differ = self
|
||||
|
||||
let statusline = printf('[%s:%%{b:differ.from}-%%{b:differ.to}]', bufname(self.original_buffer))
|
||||
if &statusline =~ '%[fF]'
|
||||
let statusline = substitute(&statusline, '%[fF]', statusline, '')
|
||||
endif
|
||||
exe "setlocal statusline=" . escape(statusline, ' |')
|
||||
exe "set filetype=" . self.filetype
|
||||
setlocal bufhidden=hide
|
||||
if g:linediff_buffer_type == 'tempfile'
|
||||
let statusline = printf('[%s:%%{b:differ.from}-%%{b:differ.to}]', bufname(self.original_buffer))
|
||||
if &statusline =~ '%[fF]'
|
||||
let statusline = substitute(&statusline, '%[fF]', escape(statusline, '\'), '')
|
||||
endif
|
||||
let &l:statusline = statusline
|
||||
exe "set filetype=" . self.filetype
|
||||
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
|
||||
|
||||
function! linediff#differ#CloseDiffBuffer() dict
|
||||
function! linediff#differ#CloseDiffBuffer(force) dict
|
||||
if bufexists(self.diff_buffer)
|
||||
exe "bdelete ".self.diff_buffer
|
||||
let bang = a:force ? '!' : ''
|
||||
exe "bdelete".bang." ".self.diff_buffer
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@ -126,17 +164,25 @@ endfunction
|
||||
" update the other differ's data, provided a few conditions are met. See
|
||||
" linediff#differ#PossiblyUpdateOtherDiffer() for details.
|
||||
function! linediff#differ#UpdateOriginalBuffer() dict
|
||||
if self.IsBlank()
|
||||
return
|
||||
endif
|
||||
|
||||
let saved_diff_buffer_view = winsaveview()
|
||||
let new_lines = getbufline('%', 0, '$')
|
||||
|
||||
" Switch to the original buffer, delete the relevant lines, add the new
|
||||
" ones, switch back to the diff buffer.
|
||||
set bufhidden=hide
|
||||
call linediff#util#SwitchBuffer(self.original_buffer)
|
||||
let saved_cursor = getpos('.')
|
||||
let saved_original_buffer_view = winsaveview()
|
||||
call cursor(self.from, 1)
|
||||
exe "silent! ".(self.to - self.from + 1)."foldopen!"
|
||||
exe "normal! ".(self.to - self.from + 1)."dd"
|
||||
call append(self.from - 1, new_lines)
|
||||
call setpos('.', saved_cursor)
|
||||
call winrestview(saved_original_buffer_view)
|
||||
call linediff#util#SwitchBuffer(self.diff_buffer)
|
||||
set bufhidden=wipe
|
||||
|
||||
" Keep the difference in lines to know how to update the other differ if
|
||||
" necessary.
|
||||
@ -148,6 +194,7 @@ function! linediff#differ#UpdateOriginalBuffer() dict
|
||||
call self.SetupSigns()
|
||||
|
||||
call self.PossiblyUpdateOtherDiffer(new_line_count - line_count)
|
||||
call winrestview(saved_diff_buffer_view)
|
||||
endfunction
|
||||
|
||||
" If the other differ originates from the same buffer and it's located below
|
||||
|
@ -2,8 +2,8 @@
|
||||
" @Website: http://www.vim.org/account/profile.php?user_id=4037
|
||||
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
|
||||
" @Created: 2007-09-17.
|
||||
" @Last Change: 2014-02-05.
|
||||
" @Revision: 1587
|
||||
" @Last Change: 2014-06-25.
|
||||
" @Revision: 1656
|
||||
|
||||
" call tlog#Log('Load: '. expand('<sfile>')) " vimtlib-sfile
|
||||
|
||||
@ -48,13 +48,15 @@ if !exists('g:tcommentOptions')
|
||||
endif
|
||||
|
||||
if !exists('g:tcomment#options_comments')
|
||||
" Options when using a the 'comments' option.
|
||||
let g:tcomment#options_comments = {'whitespace': 'both'} "{{{2
|
||||
" Additional args for |tcomment#Comment()| when using the 'comments'
|
||||
" option.
|
||||
let g:tcomment#options_comments = {'whitespace': get(g:tcommentOptions, 'whitespace', 'both')} "{{{2
|
||||
endif
|
||||
|
||||
if !exists('g:tcomment#options_commentstring')
|
||||
" Options when using a the 'commentstring' option.
|
||||
let g:tcomment#options_commentstring = {'whitespace': 'both'} "{{{2
|
||||
" Additional args for |tcomment#Comment()| when using the
|
||||
" 'commentstring' option.
|
||||
let g:tcomment#options_commentstring = {'whitespace': get(g:tcommentOptions, 'whitespace', 'both')} "{{{2
|
||||
endif
|
||||
|
||||
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
|
||||
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:definitions = {}
|
||||
@ -330,6 +348,7 @@ call tcomment#DefineType('ada', '-- %s' )
|
||||
call tcomment#DefineType('apache', '# %s' )
|
||||
call tcomment#DefineType('asciidoc', '// %s' )
|
||||
call tcomment#DefineType('asm', '; %s' )
|
||||
call tcomment#DefineType('asterisk', '; %s' )
|
||||
call tcomment#DefineType('blade', '{{-- %s --}}' )
|
||||
call tcomment#DefineType('blade_block', '{{-- %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('coffee', '# %s' )
|
||||
call tcomment#DefineType('conf', '# %s' )
|
||||
call tcomment#DefineType('context', '%% %s' )
|
||||
call tcomment#DefineType('conkyrc', '# %s' )
|
||||
call tcomment#DefineType('cpp', '// %s' )
|
||||
call tcomment#DefineType('cpp_block', g:tcommentBlockC )
|
||||
@ -371,6 +391,7 @@ call tcomment#DefineType('dsl', '; %s' )
|
||||
call tcomment#DefineType('dustjs', '{! %s !}' )
|
||||
call tcomment#DefineType('dylan', '// %s' )
|
||||
call tcomment#DefineType('eiffel', '-- %s' )
|
||||
call tcomment#DefineType('elixir', '# %s' )
|
||||
call tcomment#DefineType('erlang', '%%%% %s' )
|
||||
call tcomment#DefineType('eruby', '<%%# %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('ini', '; %s' ) " php ini (/etc/php5/...)
|
||||
call tcomment#DefineType('io', '// %s' )
|
||||
call tcomment#DefineType('jade', '// %s' )
|
||||
call tcomment#DefineType('jasmine', '# %s' )
|
||||
call tcomment#DefineType('java', '/* %s */' )
|
||||
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('nginx', '# %s' )
|
||||
call tcomment#DefineType('nroff', '.\\" %s' )
|
||||
call tcomment#DefineType('noweb', '%% %s' )
|
||||
call tcomment#DefineType('nsis', '# %s' )
|
||||
call tcomment#DefineType('objc', '/* %s */' )
|
||||
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('prolog', '%% %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('qml', '// %s' )
|
||||
call tcomment#DefineType('r', '# %s' )
|
||||
@ -588,11 +614,14 @@ let s:null_comment_string = '%s'
|
||||
" comment_mode (see also ¦g:tcommentModeExtra¦):
|
||||
" G ... guess the value of comment_mode
|
||||
" B ... block (use extra lines for the comment markers)
|
||||
" L ... lines
|
||||
" i ... maybe inline, guess
|
||||
" I ... inline
|
||||
" R ... right (comment the line right of the cursor)
|
||||
" v ... visual
|
||||
" 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
|
||||
" prefix and postfix.
|
||||
function! tcomment#Comment(beg, end, ...)
|
||||
@ -634,9 +663,11 @@ function! tcomment#Comment(beg, end, ...)
|
||||
endif
|
||||
" TLogVAR comment_mode
|
||||
endif
|
||||
if exists('s:temp_options') && has_key(s:temp_options, 'mode_extra')
|
||||
let comment_mode = s:AddModeExtra(comment_mode, s:temp_options.mode_extra, lbeg, lend)
|
||||
" TLogVAR comment_mode
|
||||
let mode_extra = s:GetTempOption('mode_extra', '')
|
||||
" TLogVAR mode_extra
|
||||
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
|
||||
endif
|
||||
" get the correct commentstring
|
||||
@ -698,10 +729,10 @@ function! tcomment#Comment(beg, end, ...)
|
||||
" echom "DBG" string(a:000)
|
||||
let cms0 = s:BlockGetCommentRx(cdef)
|
||||
" TLogVAR cms0
|
||||
" make whitespace optional; this conflicts with comments that require some
|
||||
" whitespace
|
||||
"" make whitespace optional; this conflicts with comments that require some
|
||||
"" whitespace
|
||||
let cmt_check = substitute(cms0, '\([ ]\)', '\1\\?', 'g')
|
||||
" turn commentstring into a search pattern
|
||||
"" turn commentstring into a search pattern
|
||||
" TLogVAR cmt_check
|
||||
let cmt_check = printf(cmt_check, '\(\_.\{-}\)')
|
||||
" TLogVAR cdef, cmt_check
|
||||
@ -712,9 +743,12 @@ function! tcomment#Comment(beg, end, ...)
|
||||
" echom "DBG" string(s:cdef)
|
||||
let cbeg = get(s:cdef, 'col', cbeg)
|
||||
" TLogVAR cbeg
|
||||
if comment_anyway
|
||||
if mode_extra =~# 'U'
|
||||
let uncomment = 1
|
||||
elseif mode_extra =~# 'C' || comment_anyway
|
||||
let uncomment = 0
|
||||
endif
|
||||
" TLogVAR comment_anyway, mode_extra, uncomment
|
||||
" go
|
||||
" TLogVAR comment_mode
|
||||
if comment_mode =~# 'B'
|
||||
@ -805,6 +839,15 @@ else
|
||||
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
|
||||
" TLogVAR a:name, a:arg
|
||||
if !exists('s:temp_options')
|
||||
@ -1063,7 +1106,7 @@ endf
|
||||
|
||||
function! tcomment#OperatorLine(type) "{{{3
|
||||
" TLogVAR a:type
|
||||
call tcomment#Operator('line', 'G')
|
||||
call tcomment#Operator('line', 'L')
|
||||
endf
|
||||
|
||||
|
||||
@ -1075,7 +1118,7 @@ endf
|
||||
|
||||
function! tcomment#OperatorLineAnyway(type) "{{{3
|
||||
" TLogVAR a:type
|
||||
call tcomment#Operator('line', 'G', '!')
|
||||
call tcomment#Operator('line', 'L', '!')
|
||||
endf
|
||||
|
||||
|
||||
@ -1235,12 +1278,12 @@ function! s:StartPosRx(comment_mode, line, col)
|
||||
endf
|
||||
|
||||
|
||||
function! s:EndPosRx(comment_mode, line, col)
|
||||
" TLogVAR a:comment_mode, a:line, a:col
|
||||
function! s:EndPosRx(comment_mode, lnum, col)
|
||||
" TLogVAR a:comment_mode, a:lnum, a:col
|
||||
" if a:comment_mode =~# 'I'
|
||||
" return s:EndLineRx(a:line) . s:EndColRx(a:col)
|
||||
" return s:EndLineRx(a:lnum) . s:EndColRx(a:col)
|
||||
" else
|
||||
return s:EndColRx(a:comment_mode, a:col)
|
||||
return s:EndColRx(a:comment_mode, a:lnum, a:col)
|
||||
" endif
|
||||
endf
|
||||
|
||||
@ -1276,9 +1319,12 @@ function! s:StartColRx(comment_mode, col, ...)
|
||||
endf
|
||||
|
||||
|
||||
function! s:EndColRx(comment_mode, pos)
|
||||
" TLogVAR a:comment_mode, a:pos
|
||||
if a:pos == 0
|
||||
function! s:EndColRx(comment_mode, lnum, pos)
|
||||
" TLogVAR a:comment_mode, a:lnum, a:pos
|
||||
let line = getline(a:lnum)
|
||||
let cend = s:Strdisplaywidth(line)
|
||||
" TLogVAR cend
|
||||
if a:pos == 0 || a:pos >= cend
|
||||
return '\$'
|
||||
else
|
||||
if a:comment_mode =~? 'i' && a:comment_mode =~# 'o'
|
||||
@ -1302,7 +1348,7 @@ function! s:CommentDef(beg, end, checkRx, comment_mode, cbeg, cend)
|
||||
else
|
||||
let mdrx = '\V'. s:StartColRx(a:comment_mode, a:cbeg) .'\s\*'
|
||||
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)
|
||||
" TLogVAR mdrx
|
||||
let line = getline(beg)
|
||||
@ -1396,10 +1442,10 @@ function! s:ProcessLine(uncomment, match, checkRx, replace)
|
||||
endif
|
||||
endif
|
||||
" TLogVAR rv
|
||||
if v:version > 702 || (v:version == 702 && has('patch407'))
|
||||
let rv = escape(rv, "\r")
|
||||
else
|
||||
if g:tcomment#must_escape_expression_backslash
|
||||
let rv = escape(rv, "\\r")
|
||||
else
|
||||
let rv = escape(rv, "\r")
|
||||
endif
|
||||
" TLogVAR rv
|
||||
" 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
|
||||
let @t = substitute(@t, '\V\^\s\*'. a:checkRx .'\$', '\1', '')
|
||||
let tt = []
|
||||
let rx = '\V'. s:StartColRx(a:comment_mode, a:cbeg) . '\zs\s\*'. mx
|
||||
" TLogVAR rx
|
||||
" TODO: Correctly handle foreign comments with inconsistent
|
||||
" 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')
|
||||
let line1 = substitute(line, rx, '', 'g')
|
||||
call add(tt, line1)
|
||||
@ -1907,7 +1955,7 @@ function! s:GuessCustomCommentString(ft, comment_mode, ...)
|
||||
let default_cdef = a:0 >= 2 ? a:2 : {}
|
||||
let default_supports_comment_mode = get(default_cdef, 'comment_mode', custom_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)
|
||||
" TLogVAR 1, def
|
||||
elseif !empty(custom_comment)
|
||||
|
@ -1,38 +1,14 @@
|
||||
*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|)
|
||||
|
||||
This plugin is only available if 'compatible' is not set.
|
||||
|
||||
INTRODUCTION *fugitive*
|
||||
|
||||
Install in ~/.vim, or in ~\vimfiles if you're on Windows and feeling lucky.
|
||||
Vim 7.2 is recommended as it ships with syntax highlighting for many Git file
|
||||
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.
|
||||
Whenever you edit a file from a Git repository, a set of commands is defined
|
||||
that serve as a gateway to Git.
|
||||
|
||||
COMMANDS *fugitive-commands*
|
||||
|
||||
@ -43,6 +19,10 @@ that are part of Git repositories).
|
||||
:Git [args] Run an arbitrary git command. Similar to :!git [args]
|
||||
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*
|
||||
:Gcd [directory] |:cd| relative to the repository.
|
||||
|
||||
@ -51,37 +31,87 @@ that are part of Git repositories).
|
||||
|
||||
*fugitive-:Gstatus*
|
||||
:Gstatus Bring up the output of git-status in the preview
|
||||
window. In addition to standard motions, you can
|
||||
use <C-N> and <C-P> to jump from filename to
|
||||
filename. Press C to invoke |:Gcommit|. Press D to
|
||||
|:Gdiff| the file on the cursor line, or ds to
|
||||
|:Gsdiff|. Press - to stage or unstage the file on
|
||||
the cursor line. Press p to do so on a per hunk basis
|
||||
(--patch). All of D, -, and p have a different,
|
||||
sensible (and hopefully intuitive) behavior when
|
||||
invoked on a heading rather than a file name.
|
||||
window. The following maps, which work on the cursor
|
||||
line file where sensible, are provided:
|
||||
|
||||
g? show this help
|
||||
<C-N> next file
|
||||
<C-P> previous file
|
||||
<CR> |:Gedit|
|
||||
- |:Git| add
|
||||
- |: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*
|
||||
:Gcommit [args] A wrapper around git-commit. If there is nothing
|
||||
to commit, |:Gstatus| is called instead. Unless the
|
||||
arguments given would skip the invocation of an editor
|
||||
(e.g., -m), a split window will be used to obtain a
|
||||
commit message. Write and close that window (:wq or
|
||||
|:Gwrite|) to finish the commit. Unlike when running
|
||||
the actual git-commit command, it is possible (but
|
||||
unadvisable) to muck with the index with commands like
|
||||
git-add and git-reset while a commit message is
|
||||
pending.
|
||||
commit message, or a new tab if -v is given. Write
|
||||
and close that window (:wq or |:Gwrite|) to finish the
|
||||
commit. Unlike when running the actual git-commit
|
||||
command, it is possible (but unadvisable) to alter the
|
||||
index with commands like git-add and git-reset while a
|
||||
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*
|
||||
:Ggrep [args] |:grep| with git-grep as 'grepprg'.
|
||||
|
||||
*fugitive-:Glgrep*
|
||||
:Glgrep [args] |:lgrep| with git-grep as 'grepprg'.
|
||||
|
||||
*fugitive-:Glog*
|
||||
:Glog [args] Load all previous revisions of the current file into
|
||||
the quickfix list. Additional git-log arguments can
|
||||
be given (for example, --reverse). If "--" appears as
|
||||
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*
|
||||
:Gedit [revision] |:edit| a |fugitive-revision|.
|
||||
@ -93,10 +123,15 @@ that are part of Git repositories).
|
||||
:Gvsplit [revision] |:vsplit| a |fugitive-revision|.
|
||||
|
||||
*fugitive-:Gtabedit*
|
||||
:Gtabedit [revision] |:tabedit| a |fugitive-revision|
|
||||
:Gtabedit [revision] |:tabedit| a |fugitive-revision|.
|
||||
|
||||
*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*
|
||||
:Gread [revision] Empty the buffer and |:read| a |fugitive-revision|.
|
||||
@ -107,7 +142,13 @@ that are part of Git repositories).
|
||||
:{range}Gread [revision]
|
||||
|: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.
|
||||
When run in a work tree file, it is effectively git
|
||||
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
|
||||
merge conflict, making it a git-mergetool
|
||||
alternative). The newer of the two files is placed
|
||||
to the right. Use |do| and |dp| and write to the
|
||||
index file to simulate "git add --patch".
|
||||
to the right or bottom, depending on 'diffopt' and
|
||||
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*
|
||||
:Gsdiff [revision] Like |:Gdiff|, but split horizontally.
|
||||
:Gsdiff [revision] Like |:Gdiff|, but always split horizontally.
|
||||
|
||||
*fugitive-:Gvdiff*
|
||||
:Gvdiff [revision] Identical to |:Gdiff|. For symmetry with |:Gsdiff|.
|
||||
:Gvdiff [revision] Like |:Gdiff|, but always split vertically.
|
||||
|
||||
*fugitive-:Gmove*
|
||||
:Gmove {destination} Wrapper around git-mv that renames the buffer
|
||||
@ -156,10 +199,23 @@ that are part of Git repositories).
|
||||
|
||||
*fugitive-:Gblame*
|
||||
:Gblame [flags] Run git-blame on the file and open the results in a
|
||||
scroll bound vertical split. Press enter on a line to
|
||||
reblame the file as it was in that commit. You can
|
||||
give any of ltwfsMC as flags and they will be passed
|
||||
along to git-blame.
|
||||
scroll bound vertical split. You can give any of
|
||||
ltfnsewMC as flags and they will be passed along to
|
||||
git-blame. The following maps, which work on the
|
||||
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.
|
||||
|
||||
@ -172,6 +228,11 @@ that are part of Git repositories).
|
||||
"git instaweb" from a terminal). If a range is given,
|
||||
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
|
||||
than opening it.
|
||||
|
||||
@ -187,6 +248,16 @@ that are part of Git repositories).
|
||||
|
||||
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.
|
||||
|
||||
*fugitive-<CR>*
|
||||
@ -195,9 +266,16 @@ These maps are available in Git objects.
|
||||
*fugitive-o*
|
||||
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*
|
||||
O Jump to the revision under the cursor in a new tab.
|
||||
|
||||
*fugitive--*
|
||||
- Go to the tree containing the current tree or blob.
|
||||
|
||||
*fugitive-~*
|
||||
~ Go to the current file in the [count]th first
|
||||
ancestor.
|
||||
@ -208,6 +286,10 @@ P Go to the current file in the [count]th parent.
|
||||
*fugitive-C*
|
||||
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*
|
||||
a Show the current tag, commit, or tree in an alternate
|
||||
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
|
||||
<
|
||||
*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*
|
||||
|
||||
Grab the latest version or report a bug on GitHub:
|
||||
|
@ -1,9 +1,12 @@
|
||||
*linediff.txt* Diff two blocks of text
|
||||
|
||||
==============================================================================
|
||||
CONTENTS *linediff* *linediff-contents*
|
||||
|
||||
Installation...........................: |linediff-installation|
|
||||
Usage..................................: |linediff-usage|
|
||||
Commands...............................: |linediff-commands|
|
||||
Settings...............................: |linediff-settings|
|
||||
Internals..............................: |linediff-internals|
|
||||
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
|
||||
<
|
||||
|
||||
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.
|
||||
|
||||
==============================================================================
|
||||
@ -87,10 +90,72 @@ COMMANDS *linediff-commands*
|
||||
|
||||
|
||||
*: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
|
||||
buffers are untouched by this, which means that any updates
|
||||
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*
|
||||
|
@ -1529,7 +1529,10 @@ ex-visincr-IYMD visincr.txt /*ex-visincr-IYMD*
|
||||
fetch pi_netrw.txt /*fetch*
|
||||
ftp pi_netrw.txt /*ftp*
|
||||
fugitive fugitive.txt /*fugitive*
|
||||
fugitive#head(...) fugitive.txt /*fugitive#head(...)*
|
||||
fugitive#statusline() fugitive.txt /*fugitive#statusline()*
|
||||
fugitive-- fugitive.txt /*fugitive--*
|
||||
fugitive-. fugitive.txt /*fugitive-.*
|
||||
fugitive-:Gblame fugitive.txt /*fugitive-:Gblame*
|
||||
fugitive-:Gbrowse fugitive.txt /*fugitive-:Gbrowse*
|
||||
fugitive-:Gcd fugitive.txt /*fugitive-:Gcd*
|
||||
@ -1537,34 +1540,49 @@ fugitive-:Gcommit fugitive.txt /*fugitive-:Gcommit*
|
||||
fugitive-:Gdiff fugitive.txt /*fugitive-:Gdiff*
|
||||
fugitive-:Ge fugitive.txt /*fugitive-:Ge*
|
||||
fugitive-:Gedit fugitive.txt /*fugitive-:Gedit*
|
||||
fugitive-:Gfetch fugitive.txt /*fugitive-:Gfetch*
|
||||
fugitive-:Ggrep fugitive.txt /*fugitive-:Ggrep*
|
||||
fugitive-:Git fugitive.txt /*fugitive-:Git*
|
||||
fugitive-:Git! fugitive.txt /*fugitive-:Git!*
|
||||
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-:Gmerge fugitive.txt /*fugitive-:Gmerge*
|
||||
fugitive-:Gmove fugitive.txt /*fugitive-:Gmove*
|
||||
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-:Gremove fugitive.txt /*fugitive-:Gremove*
|
||||
fugitive-:Gsdiff fugitive.txt /*fugitive-:Gsdiff*
|
||||
fugitive-:Gsplit fugitive.txt /*fugitive-:Gsplit*
|
||||
fugitive-:Gsplit! fugitive.txt /*fugitive-:Gsplit!*
|
||||
fugitive-:Gstatus fugitive.txt /*fugitive-:Gstatus*
|
||||
fugitive-:Gtabedit fugitive.txt /*fugitive-:Gtabedit*
|
||||
fugitive-:Gtabedit! fugitive.txt /*fugitive-:Gtabedit!*
|
||||
fugitive-:Gvdiff fugitive.txt /*fugitive-:Gvdiff*
|
||||
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-:Gwrite fugitive.txt /*fugitive-:Gwrite*
|
||||
fugitive-<CR> fugitive.txt /*fugitive-<CR>*
|
||||
fugitive-C fugitive.txt /*fugitive-C*
|
||||
fugitive-O fugitive.txt /*fugitive-O*
|
||||
fugitive-P fugitive.txt /*fugitive-P*
|
||||
fugitive-S fugitive.txt /*fugitive-S*
|
||||
fugitive-a fugitive.txt /*fugitive-a*
|
||||
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-mappings fugitive.txt /*fugitive-mappings*
|
||||
fugitive-o fugitive.txt /*fugitive-o*
|
||||
fugitive-revision fugitive.txt /*fugitive-revision*
|
||||
fugitive-statusline fugitive.txt /*fugitive-statusline*
|
||||
fugitive-y_CTRL-G fugitive.txt /*fugitive-y_CTRL-G*
|
||||
fugitive-~ fugitive.txt /*fugitive-~*
|
||||
fugitive.txt fugitive.txt /*fugitive.txt*
|
||||
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:alignmaps_euronumber Align.txt /*g:alignmaps_euronumber*
|
||||
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_alto pi_netrw.txt /*g:netrw_alto*
|
||||
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#ignore_char_type tcomment.txt /*g:tcomment#ignore_char_type*
|
||||
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_commentstring tcomment.txt /*g:tcomment#options_commentstring*
|
||||
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:tcommentMapLeader1 tcomment.txt /*g:tcommentMapLeader1*
|
||||
g:tcommentMapLeader2 tcomment.txt /*g:tcommentMapLeader2*
|
||||
g:tcommentMapLeaderCommentAnyway tcomment.txt /*g:tcommentMapLeaderCommentAnyway*
|
||||
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:tcommentModeExtra tcomment.txt /*g:tcommentModeExtra*
|
||||
g:tcommentOpModeExtra tcomment.txt /*g:tcommentOpModeExtra*
|
||||
@ -1749,7 +1773,9 @@ linediff-contents linediff.txt /*linediff-contents*
|
||||
linediff-installation linediff.txt /*linediff-installation*
|
||||
linediff-internals linediff.txt /*linediff-internals*
|
||||
linediff-issues linediff.txt /*linediff-issues*
|
||||
linediff-settings linediff.txt /*linediff-settings*
|
||||
linediff-usage linediff.txt /*linediff-usage*
|
||||
linediff.txt linediff.txt /*linediff.txt*
|
||||
local_markfilelist pi_netrw.txt /*local_markfilelist*
|
||||
logipat LogiPat.txt /*logipat*
|
||||
logipat-arg LogiPat.txt /*logipat-arg*
|
||||
@ -1790,9 +1816,12 @@ matchit-troubleshoot matchit.txt /*matchit-troubleshoot*
|
||||
matchit-v_% matchit.txt /*matchit-v_%*
|
||||
matchit.txt matchit.txt /*matchit.txt*
|
||||
matchit.vim matchit.txt /*matchit.vim*
|
||||
n_<Plug>TComment-gC tcomment.txt /*n_<Plug>TComment-gC*
|
||||
n_<Plug>TComment-gCb tcomment.txt /*n_<Plug>TComment-gCb*
|
||||
n_<Plug>TComment-gCc tcomment.txt /*n_<Plug>TComment-gCc*
|
||||
n_<Plug>TComment-Comment tcomment.txt /*n_<Plug>TComment-Comment*
|
||||
n_<Plug>TComment-Commentb tcomment.txt /*n_<Plug>TComment-Commentb*
|
||||
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-gcb tcomment.txt /*n_<Plug>TComment-gcb*
|
||||
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*
|
||||
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-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*
|
||||
xml-plugin-callbacks xml-plugin.txt /*xml-plugin-callbacks*
|
||||
xml-plugin-html xml-plugin.txt /*xml-plugin-html*
|
||||
|
@ -40,8 +40,16 @@ and |g:tcommentMapLeaderOp2|):
|
||||
gc<Count>c{motion} :: Toggle comment text with count argument
|
||||
(see |tcomment#Comment()|)
|
||||
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:
|
||||
|
||||
@ -124,100 +132,106 @@ please make sure, you have the current version of vimball (vimscript
|
||||
========================================================================
|
||||
Contents~
|
||||
|
||||
g:tcommentMaps ...................... |g:tcommentMaps|
|
||||
g:tcommentMapLeader1 ................ |g:tcommentMapLeader1|
|
||||
g:tcommentMapLeader2 ................ |g:tcommentMapLeader2|
|
||||
g:tcommentMapLeaderOp1 .............. |g:tcommentMapLeaderOp1|
|
||||
g:tcommentMapLeaderOp2 .............. |g:tcommentMapLeaderOp2|
|
||||
g:tcommentTextObjectInlineComment ... |g:tcommentTextObjectInlineComment|
|
||||
:TComment ........................... |:TComment|
|
||||
:TCommentAs ......................... |:TCommentAs|
|
||||
:TCommentRight ...................... |:TCommentRight|
|
||||
:TCommentBlock ...................... |:TCommentBlock|
|
||||
:TCommentInline ..................... |:TCommentInline|
|
||||
:TCommentMaybeInline ................ |:TCommentMaybeInline|
|
||||
<Plug>TComment-<c-_><c-_> ........... |<Plug>TComment-<c-_><c-_>|
|
||||
v_<Plug>TComment-<c-_><c-_> ......... |v_<Plug>TComment-<c-_><c-_>|
|
||||
i_<Plug>TComment-<c-_><c-_> ......... |i_<Plug>TComment-<c-_><c-_>|
|
||||
<Plug>TComment-<c-_>p ............... |<Plug>TComment-<c-_>p|
|
||||
i_<Plug>TComment-<c-_>p ............. |i_<Plug>TComment-<c-_>p|
|
||||
<Plug>TComment-<c-_><space> ......... |<Plug>TComment-<c-_><space>|
|
||||
i_<Plug>TComment-<c-_><space> ....... |i_<Plug>TComment-<c-_><space>|
|
||||
i_<Plug>TComment-<c-_>r ............. |i_<Plug>TComment-<c-_>r|
|
||||
<Plug>TComment-<c-_>r ............... |<Plug>TComment-<c-_>r|
|
||||
v_<Plug>TComment-<c-_>i ............. |v_<Plug>TComment-<c-_>i|
|
||||
<Plug>TComment-<c-_>i ............... |<Plug>TComment-<c-_>i|
|
||||
i_<Plug>TComment-<c-_>i ............. |i_<Plug>TComment-<c-_>i|
|
||||
<Plug>TComment-<c-_>b ............... |<Plug>TComment-<c-_>b|
|
||||
i_<Plug>TComment-<c-_>b ............. |i_<Plug>TComment-<c-_>b|
|
||||
<Plug>TComment-<c-_>a ............... |<Plug>TComment-<c-_>a|
|
||||
i_<Plug>TComment-<c-_>a ............. |i_<Plug>TComment-<c-_>a|
|
||||
<Plug>TComment-<c-_>n ............... |<Plug>TComment-<c-_>n|
|
||||
i_<Plug>TComment-<c-_>n ............. |i_<Plug>TComment-<c-_>n|
|
||||
<Plug>TComment-<c-_>s ............... |<Plug>TComment-<c-_>s|
|
||||
i_<Plug>TComment-<c-_>s ............. |i_<Plug>TComment-<c-_>s|
|
||||
<Plug>TComment-<c-_>cc .............. |<Plug>TComment-<c-_>cc|
|
||||
<Plug>TComment-<c-_>ca .............. |<Plug>TComment-<c-_>ca|
|
||||
<Plug>TComment-<Leader>__ ........... |<Plug>TComment-<Leader>__|
|
||||
x_<Plug>TComment-<Leader>__ ......... |x_<Plug>TComment-<Leader>__|
|
||||
<Plug>TComment-<Leader>_p ........... |<Plug>TComment-<Leader>_p|
|
||||
<Plug>TComment-<Leader>_<space> ..... |<Plug>TComment-<Leader>_<space>|
|
||||
x_<Plug>TComment-<Leader>_i ......... |x_<Plug>TComment-<Leader>_i|
|
||||
<Plug>TComment-<Leader>_r ........... |<Plug>TComment-<Leader>_r|
|
||||
<Plug>TComment-<Leader>_b ........... |<Plug>TComment-<Leader>_b|
|
||||
<Plug>TComment-<Leader>_a ........... |<Plug>TComment-<Leader>_a|
|
||||
<Plug>TComment-<Leader>_n ........... |<Plug>TComment-<Leader>_n|
|
||||
<Plug>TComment-<Leader>_s ........... |<Plug>TComment-<Leader>_s|
|
||||
n_<Plug>TComment-gC ................. |n_<Plug>TComment-gC|
|
||||
n_<Plug>TComment-gCc ................ |n_<Plug>TComment-gCc|
|
||||
n_<Plug>TComment-gCb ................ |n_<Plug>TComment-gCb|
|
||||
x_<Plug>TComment-gC ................. |x_<Plug>TComment-gC|
|
||||
v_<Plug>TComment-ic ................. |v_<Plug>TComment-ic|
|
||||
<Plug>TComment-ic ................... |<Plug>TComment-ic|
|
||||
n_<Plug>TComment-gcc ................ |n_<Plug>TComment-gcc|
|
||||
n_<Plug>TComment-gcb ................ |n_<Plug>TComment-gcb|
|
||||
x_<Plug>TComment-gc ................. |x_<Plug>TComment-gc|
|
||||
n_<Plug>TComment-gc ................. |n_<Plug>TComment-gc|
|
||||
g:tcomment#blank_lines .............. |g:tcomment#blank_lines|
|
||||
g:tcomment#rstrip_on_uncomment ...... |g:tcomment#rstrip_on_uncomment|
|
||||
g:tcommentModeExtra ................. |g:tcommentModeExtra|
|
||||
g:tcommentOpModeExtra ............... |g:tcommentOpModeExtra|
|
||||
g:tcommentOptions ................... |g:tcommentOptions|
|
||||
g:tcomment#options_comments ......... |g:tcomment#options_comments|
|
||||
g:tcomment#options_commentstring .... |g:tcomment#options_commentstring|
|
||||
g:tcomment#ignore_char_type ......... |g:tcomment#ignore_char_type|
|
||||
g:tcommentGuessFileType ............. |g:tcommentGuessFileType|
|
||||
g:tcommentGuessFileType_dsl ......... |g:tcommentGuessFileType_dsl|
|
||||
g:tcommentGuessFileType_php ......... |g:tcommentGuessFileType_php|
|
||||
g:tcommentGuessFileType_blade ....... |g:tcommentGuessFileType_blade|
|
||||
g:tcommentGuessFileType_html ........ |g:tcommentGuessFileType_html|
|
||||
g:tcommentGuessFileType_tskeleton ... |g:tcommentGuessFileType_tskeleton|
|
||||
g:tcommentGuessFileType_vim ......... |g:tcommentGuessFileType_vim|
|
||||
g:tcommentGuessFileType_django ...... |g:tcommentGuessFileType_django|
|
||||
g:tcommentGuessFileType_eruby ....... |g:tcommentGuessFileType_eruby|
|
||||
g:tcommentGuessFileType_smarty ...... |g:tcommentGuessFileType_smarty|
|
||||
g:tcommentIgnoreTypes_php ........... |g:tcommentIgnoreTypes_php|
|
||||
g:tcomment#syntax_substitute ........ |g:tcomment#syntax_substitute|
|
||||
g:tcommentSyntaxMap ................. |g:tcommentSyntaxMap|
|
||||
g:tcomment#replacements_c ........... |g:tcomment#replacements_c|
|
||||
g:tcommentInlineC ................... |g:tcommentInlineC|
|
||||
g:tcommentBlockC2 ................... |g:tcommentBlockC2|
|
||||
g:tcomment#replacements_xml ......... |g:tcomment#replacements_xml|
|
||||
g:tcommentBlockXML .................. |g:tcommentBlockXML|
|
||||
g:tcommentInlineXML ................. |g:tcommentInlineXML|
|
||||
g:tcomment#ignore_comment_def ....... |g:tcomment#ignore_comment_def|
|
||||
tcomment#DefineType ................. |tcomment#DefineType()|
|
||||
tcomment#GetCommentDef .............. |tcomment#GetCommentDef()|
|
||||
g:tcomment_types .................... |g:tcomment_types|
|
||||
tcomment#Comment .................... |tcomment#Comment()|
|
||||
tcomment#SetOption .................. |tcomment#SetOption()|
|
||||
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()|
|
||||
g:tcommentMaps ................................ |g:tcommentMaps|
|
||||
g:tcommentMapLeader1 .......................... |g:tcommentMapLeader1|
|
||||
g:tcommentMapLeader2 .......................... |g:tcommentMapLeader2|
|
||||
g:tcommentMapLeaderOp1 ........................ |g:tcommentMapLeaderOp1|
|
||||
g:tcommentMapLeaderUncommentAnyway ............ |g:tcommentMapLeaderUncommentAnyway|
|
||||
g:tcommentMapLeaderCommentAnyway .............. |g:tcommentMapLeaderCommentAnyway|
|
||||
g:tcommentTextObjectInlineComment ............. |g:tcommentTextObjectInlineComment|
|
||||
:TComment ..................................... |:TComment|
|
||||
:TCommentAs ................................... |:TCommentAs|
|
||||
:TCommentRight ................................ |:TCommentRight|
|
||||
:TCommentBlock ................................ |:TCommentBlock|
|
||||
:TCommentInline ............................... |:TCommentInline|
|
||||
:TCommentMaybeInline .......................... |:TCommentMaybeInline|
|
||||
<Plug>TComment-<c-_><c-_> ..................... |<Plug>TComment-<c-_><c-_>|
|
||||
v_<Plug>TComment-<c-_><c-_> ................... |v_<Plug>TComment-<c-_><c-_>|
|
||||
i_<Plug>TComment-<c-_><c-_> ................... |i_<Plug>TComment-<c-_><c-_>|
|
||||
<Plug>TComment-<c-_>p ......................... |<Plug>TComment-<c-_>p|
|
||||
i_<Plug>TComment-<c-_>p ....................... |i_<Plug>TComment-<c-_>p|
|
||||
<Plug>TComment-<c-_><space> ................... |<Plug>TComment-<c-_><space>|
|
||||
i_<Plug>TComment-<c-_><space> ................. |i_<Plug>TComment-<c-_><space>|
|
||||
i_<Plug>TComment-<c-_>r ....................... |i_<Plug>TComment-<c-_>r|
|
||||
<Plug>TComment-<c-_>r ......................... |<Plug>TComment-<c-_>r|
|
||||
v_<Plug>TComment-<c-_>i ....................... |v_<Plug>TComment-<c-_>i|
|
||||
<Plug>TComment-<c-_>i ......................... |<Plug>TComment-<c-_>i|
|
||||
i_<Plug>TComment-<c-_>i ....................... |i_<Plug>TComment-<c-_>i|
|
||||
<Plug>TComment-<c-_>b ......................... |<Plug>TComment-<c-_>b|
|
||||
i_<Plug>TComment-<c-_>b ....................... |i_<Plug>TComment-<c-_>b|
|
||||
<Plug>TComment-<c-_>a ......................... |<Plug>TComment-<c-_>a|
|
||||
i_<Plug>TComment-<c-_>a ....................... |i_<Plug>TComment-<c-_>a|
|
||||
<Plug>TComment-<c-_>n ......................... |<Plug>TComment-<c-_>n|
|
||||
i_<Plug>TComment-<c-_>n ....................... |i_<Plug>TComment-<c-_>n|
|
||||
<Plug>TComment-<c-_>s ......................... |<Plug>TComment-<c-_>s|
|
||||
i_<Plug>TComment-<c-_>s ....................... |i_<Plug>TComment-<c-_>s|
|
||||
<Plug>TComment-<c-_>cc ........................ |<Plug>TComment-<c-_>cc|
|
||||
<Plug>TComment-<c-_>ca ........................ |<Plug>TComment-<c-_>ca|
|
||||
<Plug>TComment-<Leader>__ ..................... |<Plug>TComment-<Leader>__|
|
||||
x_<Plug>TComment-<Leader>__ ................... |x_<Plug>TComment-<Leader>__|
|
||||
<Plug>TComment-<Leader>_p ..................... |<Plug>TComment-<Leader>_p|
|
||||
<Plug>TComment-<Leader>_<space> ............... |<Plug>TComment-<Leader>_<space>|
|
||||
x_<Plug>TComment-<Leader>_i ................... |x_<Plug>TComment-<Leader>_i|
|
||||
<Plug>TComment-<Leader>_r ..................... |<Plug>TComment-<Leader>_r|
|
||||
<Plug>TComment-<Leader>_b ..................... |<Plug>TComment-<Leader>_b|
|
||||
<Plug>TComment-<Leader>_a ..................... |<Plug>TComment-<Leader>_a|
|
||||
<Plug>TComment-<Leader>_n ..................... |<Plug>TComment-<Leader>_n|
|
||||
<Plug>TComment-<Leader>_s ..................... |<Plug>TComment-<Leader>_s|
|
||||
n_<Plug>TComment-Uncomment .................... |n_<Plug>TComment-Uncomment|
|
||||
n_<Plug>TComment-Uncommentc ................... |n_<Plug>TComment-Uncommentc|
|
||||
n_<Plug>TComment-Uncommentb ................... |n_<Plug>TComment-Uncommentb|
|
||||
x_<Plug>TComment-Uncomment .................... |x_<Plug>TComment-Uncomment|
|
||||
n_<Plug>TComment-Comment ...................... |n_<Plug>TComment-Comment|
|
||||
n_<Plug>TComment-Commentc ..................... |n_<Plug>TComment-Commentc|
|
||||
n_<Plug>TComment-Commentb ..................... |n_<Plug>TComment-Commentb|
|
||||
x_<Plug>TComment-Comment ...................... |x_<Plug>TComment-Comment|
|
||||
v_<Plug>TComment-ic ........................... |v_<Plug>TComment-ic|
|
||||
<Plug>TComment-ic ............................. |<Plug>TComment-ic|
|
||||
n_<Plug>TComment-gcc .......................... |n_<Plug>TComment-gcc|
|
||||
n_<Plug>TComment-gcb .......................... |n_<Plug>TComment-gcb|
|
||||
x_<Plug>TComment-gc ........................... |x_<Plug>TComment-gc|
|
||||
n_<Plug>TComment-gc ........................... |n_<Plug>TComment-gc|
|
||||
g:tcomment#blank_lines ........................ |g:tcomment#blank_lines|
|
||||
g:tcomment#rstrip_on_uncomment ................ |g:tcomment#rstrip_on_uncomment|
|
||||
g:tcommentModeExtra ........................... |g:tcommentModeExtra|
|
||||
g:tcommentOpModeExtra ......................... |g:tcommentOpModeExtra|
|
||||
g:tcommentOptions ............................. |g:tcommentOptions|
|
||||
g:tcomment#options_comments ................... |g:tcomment#options_comments|
|
||||
g:tcomment#options_commentstring .............. |g:tcomment#options_commentstring|
|
||||
g:tcomment#ignore_char_type ................... |g:tcomment#ignore_char_type|
|
||||
g:tcommentGuessFileType ....................... |g:tcommentGuessFileType|
|
||||
g:tcommentGuessFileType_dsl ................... |g:tcommentGuessFileType_dsl|
|
||||
g:tcommentGuessFileType_php ................... |g:tcommentGuessFileType_php|
|
||||
g:tcommentGuessFileType_blade ................. |g:tcommentGuessFileType_blade|
|
||||
g:tcommentGuessFileType_html .................. |g:tcommentGuessFileType_html|
|
||||
g:tcommentGuessFileType_tskeleton ............. |g:tcommentGuessFileType_tskeleton|
|
||||
g:tcommentGuessFileType_vim ................... |g:tcommentGuessFileType_vim|
|
||||
g:tcommentGuessFileType_django ................ |g:tcommentGuessFileType_django|
|
||||
g:tcommentGuessFileType_eruby ................. |g:tcommentGuessFileType_eruby|
|
||||
g:tcommentGuessFileType_smarty ................ |g:tcommentGuessFileType_smarty|
|
||||
g:tcommentIgnoreTypes_php ..................... |g:tcommentIgnoreTypes_php|
|
||||
g:tcomment#syntax_substitute .................. |g:tcomment#syntax_substitute|
|
||||
g:tcommentSyntaxMap ........................... |g:tcommentSyntaxMap|
|
||||
g:tcomment#replacements_c ..................... |g:tcomment#replacements_c|
|
||||
g:tcommentInlineC ............................. |g:tcommentInlineC|
|
||||
g:tcommentBlockC2 ............................. |g:tcommentBlockC2|
|
||||
g:tcomment#replacements_xml ................... |g:tcomment#replacements_xml|
|
||||
g:tcommentBlockXML ............................ |g:tcommentBlockXML|
|
||||
g:tcommentInlineXML ........................... |g:tcommentInlineXML|
|
||||
g:tcomment#ignore_comment_def ................. |g:tcomment#ignore_comment_def|
|
||||
g:tcomment#must_escape_expression_backslash ... |g:tcomment#must_escape_expression_backslash|
|
||||
tcomment#DefineType ........................... |tcomment#DefineType()|
|
||||
tcomment#GetCommentDef ........................ |tcomment#GetCommentDef()|
|
||||
g:tcomment_types .............................. |g:tcomment_types|
|
||||
tcomment#Comment .............................. |tcomment#Comment()|
|
||||
tcomment#SetOption ............................ |tcomment#SetOption()|
|
||||
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')
|
||||
See |tcomment-operator|.
|
||||
|
||||
*g:tcommentMapLeaderOp2*
|
||||
g:tcommentMapLeaderOp2 (default: 'gC')
|
||||
*g:tcommentMapLeaderUncommentAnyway*
|
||||
g:tcommentMapLeaderUncommentAnyway (default: 'g<')
|
||||
See |tcomment-operator|.
|
||||
|
||||
*g:tcommentMapLeaderCommentAnyway*
|
||||
g:tcommentMapLeaderCommentAnyway (default: 'g>')
|
||||
See |tcomment-operator|.
|
||||
|
||||
*g:tcommentTextObjectInlineComment*
|
||||
@ -402,17 +420,29 @@ x_<Plug>TComment-<Leader>_i ... :TCommentInline<cr>
|
||||
*<Plug>TComment-<Leader>_s*
|
||||
<Plug>TComment-<Leader>_s ... :TCommentAs <c-r>=&ft<cr>_
|
||||
|
||||
*n_<Plug>TComment-gC*
|
||||
n_<Plug>TComment-gC ... :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorAnyway<cr>g@
|
||||
*n_<Plug>TComment-Uncomment*
|
||||
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-gCc ... :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLineAnyway<cr>g@$
|
||||
*n_<Plug>TComment-Uncommentc*
|
||||
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-gCb ... :let w:tcommentPos = getpos(".") \| call tcomment#SetOption("mode_extra", "B") \| set opfunc=tcomment#OperatorLine<cr>g@
|
||||
*n_<Plug>TComment-Uncommentb*
|
||||
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-gC ... :TCommentMaybeInline!<cr>
|
||||
*x_<Plug>TComment-Uncomment*
|
||||
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 ... :<c-U>call tcomment#TextObjectInlineComment()<cr>
|
||||
@ -473,12 +503,14 @@ g:tcommentOptions (default: {})
|
||||
<
|
||||
|
||||
*g:tcomment#options_comments*
|
||||
g:tcomment#options_comments (default: {'whitespace': 'both'})
|
||||
Options when using a the 'comments' option.
|
||||
g:tcomment#options_comments (default: {'whitespace': get(g:tcommentOptions, 'whitespace', 'both')})
|
||||
Additional args for |tcomment#Comment()| when using the 'comments'
|
||||
option.
|
||||
|
||||
*g:tcomment#options_commentstring*
|
||||
g:tcomment#options_commentstring (default: {'whitespace': 'both'})
|
||||
Options when using a the 'commentstring' option.
|
||||
g:tcomment#options_commentstring (default: {'whitespace': get(g:tcommentOptions, 'whitespace', 'both')})
|
||||
Additional args for |tcomment#Comment()| when using the
|
||||
'commentstring' option.
|
||||
|
||||
*g:tcomment#ignore_char_type*
|
||||
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.
|
||||
|
||||
*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(name, commentdef, ?cdef={}, ?anyway=0)
|
||||
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¦):
|
||||
G ... guess the value of comment_mode
|
||||
B ... block (use extra lines for the comment markers)
|
||||
L ... lines
|
||||
i ... maybe inline, guess
|
||||
I ... inline
|
||||
R ... right (comment the line right of the cursor)
|
||||
v ... visual
|
||||
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
|
||||
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
@ -1,15 +1,32 @@
|
||||
if exists("g:loaded_linediff") || &cp
|
||||
if exists('g:loaded_linediff') || &cp
|
||||
finish
|
||||
endif
|
||||
|
||||
let g:loaded_linediff = '0.1.1' " version number
|
||||
let g:loaded_linediff = '0.2.0' " version number
|
||||
let s:keepcpo = &cpo
|
||||
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
|
||||
" needed.
|
||||
function! s:Init()
|
||||
if !exists('s:differ_one')
|
||||
if !s:IsInitialized()
|
||||
let s:differ_one = linediff#differ#New('linediff_one', 1)
|
||||
let s:differ_two = linediff#differ#New('linediff_two', 2)
|
||||
endif
|
||||
@ -24,25 +41,46 @@ function! s:Linediff(from, to)
|
||||
elseif s:differ_two.IsBlank()
|
||||
call s:differ_two.Init(a:from, a:to)
|
||||
|
||||
call s:PerformDiff(s:differ_one, s:differ_two)
|
||||
call s:PerformDiff()
|
||||
else
|
||||
call s:differ_one.Reset()
|
||||
call s:differ_two.Reset()
|
||||
|
||||
call s:LinediffReset('!')
|
||||
call s:Linediff(a:from, a:to)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
command! LinediffReset call s:LinediffReset()
|
||||
function! s:LinediffReset()
|
||||
call s:differ_one.Reset()
|
||||
call s:differ_two.Reset()
|
||||
command! -bang LinediffReset call s:LinediffReset(<q-bang>)
|
||||
function! s:LinediffReset(bang)
|
||||
if s:IsInitialized()
|
||||
let force = a:bang == '!'
|
||||
call s:differ_one.CloseAndReset(force)
|
||||
call s:differ_two.CloseAndReset(force)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:PerformDiff(one, two)
|
||||
call a:one.CreateDiffBuffer("tabedit")
|
||||
call a:two.CreateDiffBuffer("rightbelow vsplit")
|
||||
|
||||
let a:one.other_differ = a:two
|
||||
let a:two.other_differ = a:one
|
||||
" Checks whether plugin is initialized.
|
||||
function! s:IsInitialized()
|
||||
return exists('s:differ_one')
|
||||
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
|
||||
|
@ -2,14 +2,14 @@
|
||||
" @Author: Tom Link (micathom AT gmail com)
|
||||
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
|
||||
" @Created: 27-Dez-2004.
|
||||
" @Last Change: 2014-02-05.
|
||||
" @Revision: 811
|
||||
" @Last Change: 2014-06-30.
|
||||
" @Revision: 840
|
||||
" GetLatestVimScripts: 1173 1 tcomment.vim
|
||||
|
||||
if &cp || exists('loaded_tcomment')
|
||||
finish
|
||||
endif
|
||||
let loaded_tcomment = 303
|
||||
let loaded_tcomment = 304
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
@ -37,9 +37,14 @@ if !exists("g:tcommentMapLeaderOp1")
|
||||
let g:tcommentMapLeaderOp1 = 'gc' "{{{2
|
||||
endif
|
||||
|
||||
if !exists("g:tcommentMapLeaderOp2")
|
||||
if !exists("g:tcommentMapLeaderUncommentAnyway")
|
||||
" 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
|
||||
|
||||
if !exists('g:tcommentTextObjectInlineComment')
|
||||
@ -56,7 +61,7 @@ endif
|
||||
" ARGS... are either (see also |tcomment#Comment()|):
|
||||
" 1. a list of key=value pairs
|
||||
" 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>)
|
||||
|
||||
" :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()|):
|
||||
" 1. a list of key=value pairs
|
||||
" 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>)
|
||||
|
||||
" :display: :[range]TCommentRight[!] ?ARGS...
|
||||
@ -78,7 +83,7 @@ command! -bang -complete=customlist,tcomment#Complete -range -nargs=+ TCommentAs
|
||||
" ARGS... are either (see also |tcomment#Comment()|):
|
||||
" 1. a list of key=value pairs
|
||||
" 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>)
|
||||
|
||||
" :display: :[range]TCommentBlock[!] ?ARGS...
|
||||
@ -89,7 +94,7 @@ command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TComme
|
||||
" ARGS... are either (see also |tcomment#Comment()|):
|
||||
" 1. a list of key=value pairs
|
||||
" 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>)
|
||||
|
||||
" :display: :[range]TCommentInline[!] ?ARGS...
|
||||
@ -99,7 +104,7 @@ command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TComme
|
||||
" ARGS... are either (see also |tcomment#Comment()|):
|
||||
" 1. a list of key=value pairs
|
||||
" 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>)
|
||||
|
||||
" :display: :[range]TCommentMaybeInline[!] ?ARGS...
|
||||
@ -108,7 +113,7 @@ command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TComme
|
||||
" ARGS... are either (see also |tcomment#Comment()|):
|
||||
" 1. a list of key=value pairs
|
||||
" 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>)
|
||||
|
||||
|
||||
@ -146,10 +151,15 @@ noremap <Plug>TComment-<Leader>_a :TCommentAs
|
||||
noremap <Plug>TComment-<Leader>_n :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-gCc :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@
|
||||
xnoremap <Plug>TComment-gC :TCommentMaybeInline!<cr>
|
||||
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-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-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 <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>
|
||||
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 'xmap '. g:tcommentMapLeaderOp1 .' <Plug>TComment-gc'
|
||||
endif
|
||||
if g:tcommentMapLeaderOp2 != ''
|
||||
exec 'nmap <silent> '. g:tcommentMapLeaderOp2 .' <Plug>TComment-gC'
|
||||
exec 'nmap <silent> '. g:tcommentMapLeaderOp2 .'c <Plug>TComment-gCc'
|
||||
exec 'nmap <silent> '. g:tcommentMapLeaderOp2 .'b <Plug>TComment-gCb'
|
||||
exec 'xmap '. g:tcommentMapLeaderOp2 .' <Plug>TComment-gC'
|
||||
if g:tcommentMapLeaderUncommentAnyway != ''
|
||||
exec 'nmap <silent> '. g:tcommentMapLeaderUncommentAnyway .' <Plug>TComment-Uncomment'
|
||||
exec 'nmap <silent> '. g:tcommentMapLeaderUncommentAnyway .'c <Plug>TComment-Uncommentc'
|
||||
exec 'nmap <silent> '. g:tcommentMapLeaderUncommentAnyway .'b <Plug>TComment-Uncommentb'
|
||||
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
|
||||
if g:tcommentTextObjectInlineComment != ''
|
||||
exec 'vmap' g:tcommentTextObjectInlineComment ' <Plug>TComment-ic'
|
||||
|
Loading…
x
Reference in New Issue
Block a user