Code Monkey home page Code Monkey logo

tcomment's Introduction

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

tcomment's People

Contributors

edmitry avatar tomtom avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.