This is a plugin for quickly and efficiently commenting code
With this plugin, you can annotate files of multiple file types in different ways and quickly. This is a powerful tool for improving efficiency and pleasure for the students who use vim to write code or modify configuration files. You can go here to download this plugin, the compressed package inside the doc/and plugin/folder to ~/.vim/below is installed. In order to be able to use its help documentation, you also need to do this in vim: Helptags ~/.vim/doc/to register.
This paper introduces the common key bindings of nerd commenter, and uses the method of using C + + file as an example, please: H nerdcommenter. In normal or Visual mode:
After testing, you want the following command to take effect, you need to place the cursor in the blank space of each line, that is, the cursor cannot have characters.
- , CA, switch between optional annotation modes, such as block comments/*///and line comments//
- , CC, note when moving forward
- , c, toggle comment/non-comment status
- , CS, commenting in a "sexy" way
- , CA, add an annotation at the end of the current line, and enter insert mode
- , Cu, uncomment
- In normal mode, you can specify the number of rows in front of almost any command. For example, the input 6,cs means to comment the cursor in a sexy way to start 6 lines of code
- Execute commands in visual mode to comment/counter-annotate specific chunks that are selected
In addition, other Nerdcommenter commands can enter commands in normal mode: Map See. And here's my
Note: Each command prefix can be set by itself, usually a comma ', ' or ' \ '.
Note: Look at the name to know that it and the NERD tree belong to the same author
"Summary" Vim plugin NERD commenter