Skip to content
An extensible & universal comment plugin that also handles embedded filetypes
VimL
Latest commit e9ee1ca Oct 2, 2015 @tomtom tomtom committed with Version 3.07@1
- FIX #137: Prefer // for rust comments- FIX #138: Support for jinja filetype (see https://github.com/Glench/Vim-Jinja2-Syntax)- FIX #140: s:MapOp(): Don't evaluate registers to define op functions- s:MapOp: Remove count argument- support Tupfile comments- Merge pull request #141 from cfillion/tup-comments- FIX #123: GuessFileType(): don't use indent(); properly handle tabs- GuessFileType(): Use strwidth() (FIX #144)- autoload: Add Makefile support- Merge pull request #146 from JIghtuse/master- FIX #147: Add definition for robot file; re-enable col attribute (comment mode only)- FIX #148: Prefer // for java comments- Merge pull request #149 from phphong/change-java-default- support commenting for the fish shell- Merge pull request #150 from philolo1/support_fish- Add support for Facebook JSX- Merge pull request #151 from epeli/jsx- CLOSE #152: postprocess_uncomment option- Support for markdownMD5 checksum: 4d11779a42c22ea2dbb5f1309b29bce3
Failed to load latest commit information.
autoload Version 3.07@1 Oct 3, 2015
doc Version 3.07@1 Oct 4, 2015
plugin Version 3.07@1 Oct 4, 2015
README Version 0.1: Initial upload Nov 13, 2010

README

This is a mirror of http://www.vim.org/scripts/script.php?script_id=1173

:TComment works like a toggle, i.e., it will comment out text that 
contains uncommented lines, and it will uncomment 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 based on the values of &commentstring or &comments. 
For some filetypes, the comment definition is explicitly defined. You can 
|tcomment#DefineType()| to add your own definitions.

TComment knows how to deal with embedded code of a different filetype 
than the main filetype, e.g., ruby/python/perl regions in vim scripts, HTML or 
JavaScript in php code etc.

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

Primary key maps:

    <c-_><c-_>   :: :TComment
    <c-_><space> :: :TComment <QUERY COMMENT-BEGIN ?COMMENT-END>
    <c-_>b       :: :TCommentBlock
    <c-_>a       :: :TCommentAs <QUERY COMMENT TYPE>
    <c-_>n       :: :TCommentAs &filetype <QUERY COUNT>
    <c-_>s       :: :TCommentAs &filetype_<QUERY COMMENT SUBTYPE>
    <c-_>i       :: :TCommentInline
    <c-_>r       :: :TCommentRight
    <c-_>p       :: Comment the current inner paragraph

There is also a secondary set of key maps with <Leader>_ as leader (more 
preferable on terminals).

The full documentation is available here:
http://github.com/tomtom/tcomment_vim/blob/master/doc/tcomment.txt

Demo:
http://vimsomnia.blogspot.com/2010/11/tcomment-vim-plugin.html

Also available via git
http://github.com/tomtom/tcomment_vim
Something went wrong with that request. Please try again.