From 4ceabde4b46b7ecf67feca4fe827f0d637cab2a4 Mon Sep 17 00:00:00 2001 From: alterdepp Date: Tue, 16 Aug 2011 14:11:52 +0000 Subject: [PATCH] repair tComment git-svn-id: https://vimsuite.svn.sourceforge.net/svnroot/vimsuite/trunk@206 eb2d0018-73a3-4aeb-bfe9-1def61c9ec69 --- vimfiles/GetLatest/GetLatestVimScripts.dat | 1 - vimfiles/doc/tComment.txt | 208 ----------- vimfiles/doc/tags | 16 - vimfiles/plugin/tComment.vim | 385 --------------------- 4 files changed, 610 deletions(-) delete mode 100644 vimfiles/doc/tComment.txt delete mode 100644 vimfiles/plugin/tComment.vim diff --git a/vimfiles/GetLatest/GetLatestVimScripts.dat b/vimfiles/GetLatest/GetLatestVimScripts.dat index 1a9f508..2937f10 100644 --- a/vimfiles/GetLatest/GetLatestVimScripts.dat +++ b/vimfiles/GetLatest/GetLatestVimScripts.dat @@ -9,7 +9,6 @@ ScriptID SourceID Filename 51 171 cscope_macros.vim 102 16171 DirDiff.vim 1189 8687 matrix.vim -1173 15731 tcomment 948 2878 Scons Compiler plugin 1709 6421 Scons Syntax file 1772 7248 DAMOS.zip DAMOS tools (von Stefan) diff --git a/vimfiles/doc/tComment.txt b/vimfiles/doc/tComment.txt deleted file mode 100644 index 35b66e2..0000000 --- a/vimfiles/doc/tComment.txt +++ /dev/null @@ -1,208 +0,0 @@ -*tComment.txt* tComment -- An easily extensible & universal comment plugin - -Author: Thomas Link, micathom AT gmail com?subject=vim - -tComment provides easy to use, file-type sensible comments for Vim. It -can handle embedded syntax. - - - *tComment-Installation* -Installation~ -Edit the vba file and type: - - :so % - -See :help vimball for details. If you use vim 7.0, you may need to -update your vimball installation first. - - - *tComment-Usage* -Usage~ -TComment works like a toggle, i.e., it will comment out text that -contains uncommented lines, and it will remove comment markup for -already commented text (i.e. text that contains no uncommented lines). - -If the file-type is properly defined, TComment will figure out which -comment string to use. Otherwise you use |TCommentDefineType()| to -override the default choice. - -TComment can properly handle an embedded syntax, e.g., ruby/python/perl -regions in vim scripts, HTML or JavaScript in php code etc. - - - *tComment-Key-Bindings* -Key bindings~ - -Most of the time the default toggle keys will do what you want (or to be -more precise: what I think you want it to do ;-). - - *g:tcommentMapLeaderOp1* - *g:tcommentMapLeaderOp2* -As operator (the prefix can be customized via g:tcommentMapLeaderOp1 -and g:tcommentMapLeaderOp2): - - gc{motion} :: Toggle comments (for small comments within one line - the &filetype_inline style will be used, if - defined) - gcc :: Toggle comment for the current line - gC{motion} :: Comment region - gCc :: Comment the current line - - *g:tcommentOpModeExtra* -By default the cursor stays put. If you want the cursor to the end of -the commented text, set g:tcommentOpModeExtra to '>' (but this may not -work properly with exclusive motions). - -Primary key maps: - - :: :TComment - :: :TComment - b :: :TCommentBlock - a :: :TCommentAs - n :: :TCommentAs &filetype - s :: :TCommentAs &filetype_ - i :: :TCommentInline - r :: :TCommentRight - p :: Comment the current inner paragraph - -A secondary set of key maps is defined for normal mode. - - __ :: :TComment - _p :: Comment the current inner paragraph - _ :: :TComment - _i :: :TCommentInline - _r :: :TCommentRight - _b :: :TCommentBlock - _a :: :TCommentAs - _n :: :TCommentAs &filetype - _s :: :TCommentAs &filetype_ - -Keymaps are configurable via the following variables: - - *g:tcommentMapLeader1* -g:tcommentMapLeader1 string (default: ) - Prefix for the keymaps. Set to '' to disable keymaps with this - prefix. - *g:tcommentMapLeader2* -g:tcommentMapLeader2 string (default: _) - Secondary prefix. (The reason for why there are two prefixes is - that appears preferable with gvim but can be difficult to - type on the terminal. The secondary prefix isn't used for insert - mode maps. Set to '' to disable keymaps with this prefix. - - *tComment-commands* -Alternatively, you can type (? meaning "optional argument"): - - *:TComment* - :? TComment ?commentBegin ?commentEnd - :? TComment! ?commentBegin ?commentEnd - NOTE: If there is a visual selection that begins and ends in the same - line, then TCommentInline is used instead. - - NOTE: The range is optional and defaults to the current line. - - *:TCommentInline* - :? TCommentInline ?commentBegin ?commentEnd - :? TCommentInline! ?commentBegin ?commentEnd - Use the {&ft}_inline comment style. - - *:TCommentBlock* - :? TCommentBlock ?commentBegin ?commentEnd - :? TCommentBlock! ?commentBegin ?commentEnd - Comment as "block", e.g. use the {&ft}_block comment style. - NOTE: This command is kind of crude. It doesn't indent or reformat - the text. - - *:TCommentAs* - :? TCommentAs filetype - :? TCommentAs! filetype - NOTE: TCommentAs requires g:tcomment_{filetype} to be defined. - NOTE: This command supports command line completion. See 'wildmode' - and 'wildmenu' for how to get the most out of it. - - *:TCommentRight* - :? TCommentRight - :? TCommentRight! - NOTE: This command comments out the text to the right of the cursor. - If a visual selection was made (be it block-wise or not), all lines - are commented out at from the current cursor position downwards. - - The bang (!) variants always comment out the selected text and don't - work as toggles. - - *TCommentDefineType()* - Using this command you can also use different comment styles with - the TCommentDefineType(name, commentstring) function. This function - takes two arguments: - name :: The name is either &filetype or {&filetype}_{style}. - I.e., For block comments the {&filetype}_block and for - inline comments the {&filetype}_inline styles are used. - comment string :: a string mostly as described in - 'commentstring'. - - If you want to define, e.g., a fancy block comment style for html - you put something like this into ~/.vim/after/plugin/tComment.vim:> - - call TCommentDefineType("html_fancy_block", "\n -- ") - -< The part after the newline character is used for marking "middle" - lines. - - This comment style could then be accessed via (this command has - command line completion): > - - '<,'>TCommentAs html_fancy_block - -< If you're editing a html file, this could best be done by the s - key map. - - -Goals~ -- Maintain indentation of selected text; the comment markers are left - aligned but the text on the right (i.e., the comment) is indented - like the original text - -- Handle embedded syntax like php+html or html+javaScript+css; you - have to set g:tcommentGuessFileType_{&filetype} to 1 or to the - fall-back file-type in order to activate this feature for other file - types than php or html - - tComment deduces the correct file type from the syntax name, similar - to the way EnhancedCommentify.vim does it. In opposition to - EnhancedCommentify.vim, it matches the syntax name against a list the - known file types, so that it can deal with, e.g., embedded javaScript - -- Easy to customize/adapt for an yet unknown syntax by setting buffer - local variables (b:commentStart, b:commentEnd, or b:commentstring), - global variables (g:tcomment_{&ft} and g:tcomment_{&ft}_block), or the - buffer local &commentstring option (which can be set on a vim - |modeline|) - -- Use 'commentstring' or 'comments' as a fallback (i.e., if a file-type - is properly defined, TComment will automatically support it) - -- Same short-cut for commenting text and for removing comment markup - -- The decision whether text should be commented or uncommented is made - on the basis of the whole selection (not line by line); comments in - code that should be commented aren't uncommented as it is the case - with some other plug-ins - -As of version 1.5, the following file types are explicitly defined -(other file-types are most likely supported through the 'commentstring' -or 'comments' variables): - - ada, apache, autoit, catalog, cpp, css, c, cfg, conf, desktop, - docbk, dosbatch, dosini, dsl, dylan, eiffel, gtkrc, haskell, html, - io, javaScript, java, lisp, m4, nroff, objc, ocaml, pascal, perl, - php, prolog, ruby, r, scheme, sgml, sh, sql, spec, sps, tcl, tex, - tpl, viki, vim, websec, xml, xslt, yaml - - -Credits~ -The way we check for embedded syntax was originally adapted -from/inspired by Meikel Brandmeyer's EnhancedCommentify.vim -(vimscript #23) but has evolved since. - - -vim: tw=72 diff --git a/vimfiles/doc/tags b/vimfiles/doc/tags index bf26daa..1aacebc 100644 --- a/vimfiles/doc/tags +++ b/vimfiles/doc/tags @@ -47,16 +47,11 @@ :Search MultipleSearch.txt /*:Search* :SearchBuffers MultipleSearch.txt /*:SearchBuffers* :Sexplore pi_netrw.txt /*:Sexplore* -:TComment tComment.txt /*:TComment* :TComment tcomment.txt /*:TComment* -:TCommentAs tComment.txt /*:TCommentAs* :TCommentAs tcomment.txt /*:TCommentAs* -:TCommentBlock tComment.txt /*:TCommentBlock* :TCommentBlock tcomment.txt /*:TCommentBlock* -:TCommentInline tComment.txt /*:TCommentInline* :TCommentInline tcomment.txt /*:TCommentInline* :TCommentMaybeInline tcomment.txt /*:TCommentMaybeInline* -:TCommentRight tComment.txt /*:TCommentRight* :TCommentRight tcomment.txt /*:TCommentRight* :Texplore pi_netrw.txt /*:Texplore* :UseVimball pi_vimball.txt /*:UseVimball* @@ -111,7 +106,6 @@ SRDispHiGrp SrchRplcHiGrp.txt /*SRDispHiGrp* SRHiGrp SrchRplcHiGrp.txt /*SRHiGrp* SRSearch SrchRplcHiGrp.txt /*SRSearch* SrchRplcHiGrp.txt SrchRplcHiGrp.txt /*SrchRplcHiGrp.txt* -TCommentDefineType() tComment.txt /*TCommentDefineType()* VCSCommandCVSDiffOpt vcscommand.txt /*VCSCommandCVSDiffOpt* VCSCommandCVSExec vcscommand.txt /*VCSCommandCVSExec* VCSCommandCommitOnWrite vcscommand.txt /*VCSCommandCommitOnWrite* @@ -1593,13 +1587,8 @@ g:tcommentGuessFileType_vim tcomment.txt /*g:tcommentGuessFileType_vim* g:tcommentIgnoreTypes_php tcomment.txt /*g:tcommentIgnoreTypes_php* 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:tcommentMapLeaderOp1 tComment.txt /*g:tcommentMapLeaderOp1* g:tcommentMapLeaderOp1 tcomment.txt /*g:tcommentMapLeaderOp1* -g:tcommentMapLeaderOp2 tComment.txt /*g:tcommentMapLeaderOp2* g:tcommentMapLeaderOp2 tcomment.txt /*g:tcommentMapLeaderOp2* -g:tcommentOpModeExtra tComment.txt /*g:tcommentOpModeExtra* g:tcommentOpModeExtra tcomment.txt /*g:tcommentOpModeExtra* g:tcommentOptions tcomment.txt /*g:tcommentOptions* g:tcommentSyntaxMap tcomment.txt /*g:tcommentSyntaxMap* @@ -1871,11 +1860,6 @@ srchrplchigrp SrchRplcHiGrp.txt /*srchrplchigrp* srchrplchigrp-commands SrchRplcHiGrp.txt /*srchrplchigrp-commands* srchrplchigrp-contents SrchRplcHiGrp.txt /*srchrplchigrp-contents* srchrplchigrp-examples SrchRplcHiGrp.txt /*srchrplchigrp-examples* -tComment-Installation tComment.txt /*tComment-Installation* -tComment-Key-Bindings tComment.txt /*tComment-Key-Bindings* -tComment-Usage tComment.txt /*tComment-Usage* -tComment-commands tComment.txt /*tComment-commands* -tComment.txt tComment.txt /*tComment.txt* tcomment#Comment() tcomment.txt /*tcomment#Comment()* tcomment#CommentAs() tcomment.txt /*tcomment#CommentAs()* tcomment#DefineType() tcomment.txt /*tcomment#DefineType()* diff --git a/vimfiles/plugin/tComment.vim b/vimfiles/plugin/tComment.vim deleted file mode 100644 index dc0c676..0000000 --- a/vimfiles/plugin/tComment.vim +++ /dev/null @@ -1,385 +0,0 @@ -" tComment.vim -- An easily extensible & universal comment plugin -" @Author: Tom Link (micathom AT gmail com) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Created: 27-Dez-2004. -" @Last Change: 2009-08-07. -" @Revision: 1.9.671 -" -" GetLatestVimScripts: 1173 1 tComment.vim - -if &cp || exists('loaded_tcomment') - finish -endif -let loaded_tcomment = 109 - -" If true, comment blank lines too -if !exists("g:tcommentBlankLines") - let g:tcommentBlankLines = 1 -endif - -if !exists("g:tcommentMapLeader1") - let g:tcommentMapLeader1 = '' -endif -if !exists("g:tcommentMapLeader2") - let g:tcommentMapLeader2 = '_' -endif -if !exists("g:tcommentMapLeaderOp1") - let g:tcommentMapLeaderOp1 = 'gc' -endif -if !exists("g:tcommentMapLeaderOp2") - let g:tcommentMapLeaderOp2 = 'gC' -endif -if !exists("g:tcommentOpModeExtra") - let g:tcommentOpModeExtra = '' -endif - -" Guess the file type based on syntax names always or for some fileformat only -if !exists("g:tcommentGuessFileType") - let g:tcommentGuessFileType = 0 -endif -" In php documents, the php part is usually marked as phpRegion. We thus -" assume that the buffers default comment style isn't php but html -if !exists("g:tcommentGuessFileType_dsl") - let g:tcommentGuessFileType_dsl = 'xml' -endif -if !exists("g:tcommentGuessFileType_php") - let g:tcommentGuessFileType_php = 'html' -endif -if !exists("g:tcommentGuessFileType_html") - let g:tcommentGuessFileType_html = 1 -endif -if !exists("g:tcommentGuessFileType_tskeleton") - let g:tcommentGuessFileType_tskeleton = 1 -endif -if !exists("g:tcommentGuessFileType_vim") - let g:tcommentGuessFileType_vim = 1 -endif - -if !exists("g:tcommentIgnoreTypes_php") - let g:tcommentIgnoreTypes_php = 'sql' -endif - -if !exists('g:tcommentSyntaxMap') "{{{2 - let g:tcommentSyntaxMap = { - \ 'vimMzSchemeRegion': 'scheme', - \ 'vimPerlRegion': 'perl', - \ 'vimPythonRegion': 'python', - \ 'vimRubyRegion': 'ruby', - \ 'vimTclRegion': 'tcl', - \ } -endif - -" If you don't define these variables, TComment will use &commentstring -" instead. We override the default values here in order to have a blank after -" the comment marker. Block comments work only if we explicitly define the -" markup. -" The format for block comments is similar to normal commentstrings with the -" exception that the format strings for blocks can contain a second line that -" defines how "middle lines" (see :h format-comments) should be displayed. - -" I personally find this style rather irritating but here is an alternative -" definition that does this left-handed bar thing -if !exists("g:tcommentBlockC") - let g:tcommentBlockC = "/*%s */\n * " -endif -if !exists("g:tcommentBlockC2") - let g:tcommentBlockC2 = "/**%s */\n * " -endif -if !exists("g:tcommentInlineC") - let g:tcommentInlineC = "/* %s */" -endif - -if !exists("g:tcommentBlockXML") - let g:tcommentBlockXML = "\n " -endif -if !exists("g:tcommentInlineXML") - let g:tcommentInlineXML = "" -endif - -let g:tcommentFileTypesDirty = 1 - -" Currently this function just sets a variable -function! TCommentDefineType(name, commentstring) - if !exists('g:tcomment_'. a:name) - let g:tcomment_{a:name} = a:commentstring - endif - let g:tcommentFileTypesDirty = 1 -endf - -function! TCommentTypeExists(name) - return exists('g:tcomment_'. a:name) -endf - -call TCommentDefineType('aap', '# %s' ) -call TCommentDefineType('ada', '-- %s' ) -call TCommentDefineType('apache', '# %s' ) -call TCommentDefineType('autoit', '; %s' ) -call TCommentDefineType('asm', '; %s' ) -call TCommentDefineType('awk', '# %s' ) -call TCommentDefineType('catalog', '-- %s --' ) -call TCommentDefineType('catalog_block', "--%s--\n " ) -call TCommentDefineType('cpp', '// %s' ) -call TCommentDefineType('cpp_inline', g:tcommentInlineC ) -call TCommentDefineType('cpp_block', g:tcommentBlockC ) -call TCommentDefineType('css', '/* %s */' ) -call TCommentDefineType('css_inline', g:tcommentInlineC ) -call TCommentDefineType('css_block', g:tcommentBlockC ) -call TCommentDefineType('c', '/* %s */' ) -call TCommentDefineType('c_inline', g:tcommentInlineC ) -call TCommentDefineType('c_block', g:tcommentBlockC ) -call TCommentDefineType('cfg', '# %s' ) -call TCommentDefineType('conf', '# %s' ) -call TCommentDefineType('crontab', '# %s' ) -call TCommentDefineType('desktop', '# %s' ) -call TCommentDefineType('docbk', '' ) -call TCommentDefineType('docbk_inline', g:tcommentInlineXML) -call TCommentDefineType('docbk_block', g:tcommentBlockXML ) -call TCommentDefineType('dosbatch', 'rem %s' ) -call TCommentDefineType('dosini', '; %s' ) -call TCommentDefineType('dsl', '; %s' ) -call TCommentDefineType('dylan', '// %s' ) -call TCommentDefineType('eiffel', '-- %s' ) -call TCommentDefineType('eruby', '<%%# %s%%>' ) -call TCommentDefineType('gtkrc', '# %s' ) -call TCommentDefineType('gitcommit', '# %s' ) -call TCommentDefineType('haskell', '-- %s' ) -call TCommentDefineType('haskell_block', "{-%s-}\n " ) -call TCommentDefineType('haskell_inline', '{- %s -}' ) -call TCommentDefineType('html', '' ) -call TCommentDefineType('html_inline', g:tcommentInlineXML) -call TCommentDefineType('html_block', g:tcommentBlockXML ) -call TCommentDefineType('io', '// %s' ) -call TCommentDefineType('javaScript', '// %s' ) -call TCommentDefineType('javaScript_inline', g:tcommentInlineC ) -call TCommentDefineType('javaScript_block', g:tcommentBlockC ) -call TCommentDefineType('javascript', '// %s' ) -call TCommentDefineType('javascript_inline', g:tcommentInlineC ) -call TCommentDefineType('javascript_block', g:tcommentBlockC ) -call TCommentDefineType('java', '/* %s */' ) -call TCommentDefineType('java_inline', g:tcommentInlineC ) -call TCommentDefineType('java_block', g:tcommentBlockC ) -call TCommentDefineType('java_doc_block', g:tcommentBlockC2 ) -call TCommentDefineType('jproperties', '# %s' ) -call TCommentDefineType('lisp', '; %s' ) -call TCommentDefineType('lynx', '# %s' ) -call TCommentDefineType('m4', 'dnl %s' ) -call TCommentDefineType('mail', '> %s' ) -call TCommentDefineType('msidl', '// %s' ) -call TCommentDefineType('msidl_block', g:tcommentBlockC ) -call TCommentDefineType('nroff', '.\\" %s' ) -call TCommentDefineType('nsis', '# %s' ) -call TCommentDefineType('objc', '/* %s */' ) -call TCommentDefineType('objc_inline', g:tcommentInlineC ) -call TCommentDefineType('objc_block', g:tcommentBlockC ) -call TCommentDefineType('ocaml', '(* %s *)' ) -call TCommentDefineType('ocaml_inline', '(* %s *)' ) -call TCommentDefineType('ocaml_block', "(*%s*)\n " ) -call TCommentDefineType('pascal', '(* %s *)' ) -call TCommentDefineType('pascal_inline', '(* %s *)' ) -call TCommentDefineType('pascal_block', "(*%s*)\n " ) -call TCommentDefineType('perl', '# %s' ) -call TCommentDefineType('perl_block', "=cut%s=cut" ) -call TCommentDefineType('php', '// %s' ) -call TCommentDefineType('php_inline', g:tcommentInlineC ) -call TCommentDefineType('php_block', g:tcommentBlockC ) -call TCommentDefineType('php_2_block', g:tcommentBlockC2 ) -call TCommentDefineType('po', '# %s' ) -call TCommentDefineType('prolog', '%% %s' ) -call TCommentDefineType('rc', '// %s' ) -call TCommentDefineType('readline', '# %s' ) -call TCommentDefineType('ruby', '# %s' ) -call TCommentDefineType('ruby_3', '### %s' ) -call TCommentDefineType('ruby_block', "=begin rdoc%s=end") -call TCommentDefineType('ruby_nodoc_block', "=begin%s=end" ) -call TCommentDefineType('r', '# %s' ) -call TCommentDefineType('sbs', "' %s" ) -call TCommentDefineType('scheme', '; %s' ) -call TCommentDefineType('sed', '# %s' ) -call TCommentDefineType('sgml', '' ) -call TCommentDefineType('sgml_inline', g:tcommentInlineXML) -call TCommentDefineType('sgml_block', g:tcommentBlockXML ) -call TCommentDefineType('sh', '# %s' ) -call TCommentDefineType('sql', '-- %s' ) -call TCommentDefineType('spec', '# %s' ) -call TCommentDefineType('sps', '* %s.' ) -call TCommentDefineType('sps_block', "* %s." ) -call TCommentDefineType('spss', '* %s.' ) -call TCommentDefineType('spss_block', "* %s." ) -call TCommentDefineType('tcl', '# %s' ) -call TCommentDefineType('tex', '%% %s' ) -call TCommentDefineType('tpl', '' ) -call TCommentDefineType('viki', '%% %s' ) -call TCommentDefineType('viki_3', '%%%%%% %s' ) -call TCommentDefineType('viki_inline', '{cmt: %s}' ) -call TCommentDefineType('vim', '" %s' ) -call TCommentDefineType('vim_3', '""" %s' ) -call TCommentDefineType('websec', '# %s' ) -call TCommentDefineType('xml', '' ) -call TCommentDefineType('xml_inline', g:tcommentInlineXML) -call TCommentDefineType('xml_block', g:tcommentBlockXML ) -call TCommentDefineType('xs', '// %s' ) -call TCommentDefineType('xs_block', g:tcommentBlockC ) -call TCommentDefineType('xslt', '' ) -call TCommentDefineType('xslt_inline', g:tcommentInlineXML) -call TCommentDefineType('xslt_block', g:tcommentBlockXML ) -call TCommentDefineType('yaml', '# %s' ) - - -" :line1,line2 TCommentAs commenttype -command! -bang -complete=customlist,tcomment#FileTypes -range -nargs=+ TCommentAs - \ call tcomment#CommentAs(, , "", ) - -" :line1,line2 TComment ?commentBegin ?commentEnd -command! -bang -range -nargs=* TComment keepjumps call tcomment#Comment(, , 'G', "", ) - -" :line1,line2 TCommentRight ?commentBegin ?commentEnd -command! -bang -range -nargs=* TCommentRight keepjumps call tcomment#Comment(, , 'R', "", ) - -" :line1,line2 TCommentBlock ?commentBegin ?commentEnd -command! -bang -range -nargs=* TCommentBlock keepjumps call tcomment#Comment(, , 'B', "", ) - -" :line1,line2 TCommentInline ?commentBegin ?commentEnd -command! -bang -range -nargs=* TCommentInline keepjumps call tcomment#Comment(, , 'I', "", ) - -" :line1,line2 TCommentMaybeInline ?commentBegin ?commentEnd -command! -bang -range -nargs=* TCommentMaybeInline keepjumps call tcomment#Comment(, , 'i', "", ) - - - -if (g:tcommentMapLeader1 != '') - exec 'noremap '. g:tcommentMapLeader1 .' :TComment' - exec 'vnoremap '. g:tcommentMapLeader1 .' :TCommentMaybeInline' - exec 'inoremap '. g:tcommentMapLeader1 .' :TComment' - exec 'noremap '. g:tcommentMapLeader1 .'p m`vip:TComment``' - exec 'inoremap '. g:tcommentMapLeader1 .'p :norm! m`vip:TComment``' - exec 'noremap '. g:tcommentMapLeader1 .' :TComment ' - exec 'inoremap '. g:tcommentMapLeader1 .' :TComment ' - exec 'inoremap '. g:tcommentMapLeader1 .'r :TCommentRight' - exec 'noremap '. g:tcommentMapLeader1 .'r :TCommentRight' - exec 'vnoremap '. g:tcommentMapLeader1 .'i :TCommentInline' - exec 'vnoremap '. g:tcommentMapLeader1 .'r :TCommentRight' - exec 'noremap '. g:tcommentMapLeader1 .'b :TCommentBlock' - exec 'inoremap '. g:tcommentMapLeader1 .'b :TCommentBlock' - exec 'noremap '. g:tcommentMapLeader1 .'a :TCommentAs ' - exec 'inoremap '. g:tcommentMapLeader1 .'a :TCommentAs ' - exec 'noremap '. g:tcommentMapLeader1 .'n :TCommentAs =&ft ' - exec 'inoremap '. g:tcommentMapLeader1 .'n :TCommentAs =&ft ' - exec 'noremap '. g:tcommentMapLeader1 .'s :TCommentAs =&ft_' - exec 'inoremap '. g:tcommentMapLeader1 .'s :TCommentAs =&ft_' -endif -if (g:tcommentMapLeader2 != '') - exec 'noremap '. g:tcommentMapLeader2 .'_ :TComment' - exec 'vnoremap '. g:tcommentMapLeader2 .'_ :TCommentMaybeInline' - exec 'noremap '. g:tcommentMapLeader2 .'p vip:TComment' - exec 'noremap '. g:tcommentMapLeader2 .' :TComment ' - exec 'vnoremap '. g:tcommentMapLeader2 .'i :TCommentInline' - exec 'noremap '. g:tcommentMapLeader2 .'r :TCommentRight' - exec 'vnoremap '. g:tcommentMapLeader2 .'r :TCommentRight' - exec 'noremap '. g:tcommentMapLeader2 .'b :TCommentBlock' - exec 'noremap '. g:tcommentMapLeader2 .'a :TCommentAs ' - exec 'noremap '. g:tcommentMapLeader2 .'n :TCommentAs =&ft ' - exec 'noremap '. g:tcommentMapLeader2 .'s :TCommentAs =&ft_' -endif -if (g:tcommentMapLeaderOp1 != '') - exec 'nnoremap '. g:tcommentMapLeaderOp1 .' :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#Operatorg@' - exec 'nnoremap '. g:tcommentMapLeaderOp1 .'c :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLineg@$' - exec 'vnoremap '. g:tcommentMapLeaderOp1 .' :TCommentMaybeInline' -endif -if (g:tcommentMapLeaderOp2 != '') - exec 'nnoremap '. g:tcommentMapLeaderOp2 .' :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorAnywayg@' - exec 'nnoremap '. g:tcommentMapLeaderOp2 .'c :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLineAnywayg@$' - exec 'vnoremap '. g:tcommentMapLeaderOp2 .' :TCommentMaybeInline' -endif - -finish - - ------------------------------------------------------------------------ -History - -0.1 -- Initial release - -0.2 -- Fixed uncommenting of non-aligned comments -- improved support for block comments (with middle lines and indentation) -- using TCommentBlock for file types that don't have block comments creates -single line comments -- removed the TCommentAsBlock command (TCommentAs provides its functionality) -- removed g:tcommentSetCMS -- the default key bindings have slightly changed - -1.3 -- slightly improved recognition of embedded syntax -- if no commentstring is defined in whatever way, reconstruct one from -&comments -- The TComment... commands now have bang variants that don't act as toggles -but always comment out the selected text -- fixed problem with commentstrings containing backslashes -- comment as visual block (allows commenting text to the right of the main -text, i.e., this command doesn't work on whole lines but on the text to the -right of the cursor) -- enable multimode for dsl, vim filetypes -- added explicit support for some other file types I ran into - -1.4 -- Fixed problem when &commentstring was invalid (e.g. lua) -- perl_block by Kyosuke Takayama. -- s mapped to :TCommentAs =&ft - -1.5 -- "Inline" visual comments (uses the &filetype_inline style if -available; doesn't check if the filetype actually supports this kind of -comments); tComment can't currently deduce inline comment styles from -&comments or &commentstring (I personally hardly ever use them); default -map: i or I -- In visual mode: if the selection spans several lines, normal mode is -selected; if the selection covers only a part of one line, inline mode -is selected -- Fixed problem with lines containing ^M or ^@ characters. -- It's no longer necessary to call TCommentCollectFileTypes() after -defining a new filetype via TCommentDefineType() -- Disabled single mappings -- Renamed TCommentVisualBlock to TCommentRight -- FIX: Forgot 'x' in ExtractCommentsPart() (thanks to Fredrik Acosta) - -1.6 -- Ignore sql when guessing the comment string in php files; tComment -sometimes chooses the wrong comment string because the use of sql syntax -is used too loosely in php files; if you want to comment embedded sql -code you have to use TCommentAs -- Use keepjumps in commands. -- Map p & _p to vip:TComment -- Made key maps configurable via g:tcommentMapLeader1 and -g:tcommentMapLeader2 - -1.7 -- gc{motion} (see g:tcommentMapLeaderOp1) functions as a comment toggle -operator (i.e., something like gcl... works, mostly); gC{motion} (see -g:tcommentMapLeaderOp2) will unconditionally comment the text. -- TCommentAs takes an optional second argument (the comment level) -- New "n" map: TCommentAs &filetype [COUNT] -- Defined mail comments/citations -- g:tcommentSyntaxMap: Map syntax names to filetypes for buffers with -mixed syntax groups that don't match the filetypeEmbeddedsyntax scheme (e.g. -'vimRubyRegion', which should be commented as ruby syntax, not as vim -syntax) -- FIX: Comments in vim*Region -- TComment: The use of the type argument has slightly changed (IG -> i, -new: >) - -1.8 -- Definitly require vim7 -- Split the plugin into autoload & plugin. -- g:TCommentFileTypes is a list -- Fixed some block comment strings -- Removed extraneous newline in some block comments. -- Maps for visal mode (thanks Krzysztof Goj) - -1.9 -- Fix left offset for inline comments (via operator binding) - -1.10 -- tcomment#Operator defines w:tcommentPos if invoked repeatedly -- s:GuessFileType: use len(getline()) instead of col() -