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 (#)