Vim plug-in quick comments

Source: Internet
Author: User

This is a plug-in for VIM. You can see the name. It belongs to the same author as the nerd tree. With this plug-in, you can comment out files of various file types in different ways and quickly. This is undoubtedly a tool to improve efficiency and pleasure for those who use Vim to write code or modify configuration files. You can download this plug-in here and drop the DOC/and plugin/folders in the compressed package ~ /. Vim/is installed below. To use the help documentation, you also need to execute helptags in vim.
~ /. Vim/doc/to register.

Install details
The nerd commenter requires Vim 7 or higher.


Extract the plugin files in your ~ /. Vim (* nix) or ~ /Vimfiles (Windows). You

Shocould have 2 files:

Plugin/nerd_commenter.vim

DOC/nerd_commenter.txt


Next, to finish installing the Help File run:

: Helptags ~ /. Vim/doc


See | add-local-help | for more details.


Make sure that you have filetype plugins enabled, as the script makes use

| 'Commentstring' | where possible (which is usually set in a filetype plugin ).

See | filetype-plugin-on | for details, but basically, stick this in your vimrc

Filetype plugin on

 



This section briefly describes common key binding for nerd commenter. For details about how to use the C/C ++ file, see h nerdcommenter. In normal or visual mode:

  • , CA, switch between optional annotation methods, such as C/C ++ block annotation/**/and line annotation //
  • , CC, comment the current row
  • , C, switch the annotation/non-annotation status
  • , Cs, comment in the form of "sexiness"
  • , Ca. Add the annotator at the end of the current row and enter the insert mode.
  • , Cu, uncomment
  • In normal mode, you can specify the number of rows before almost all commands.
  • When you run a command in visual mode, the specified block is commented out or commented out.

Note: The prefix of each command can be set by yourself. Generally, it is a comma ',' or '\'.

 

Hello, I have installed it according to nerd commenter, but why does CC Delete the current row when I press it? I tried \ CC and it worked. Why? Can you tell me this configuration or something? I can't find any information online. Thank you!

↑ Pengfei @ September 8, 201: 37 PM (#)
  • There is an option mapleader that defines the characters represented. Many plug-ins use this key ing. You can set mapleader =, set, ^_^ in the configuration file as needed.

  • How can I set the command prefix?

    Reply yuan @ April 1, 2011,8: 01
    PM (#)
    • Let mapleader = ","

      Reference: H <leader>

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.