日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

vim 代码注释插件

發布時間:2024/8/23 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 vim 代码注释插件 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

參考:

1、http://www.vim.org/scripts/script.php?script_id=1218

2、http://www.dutor.net/index.php/2010/05/vim-the-nerd-commenter/

?

參考1:

The following key mappings are provided by default (there is also a menu
provided that contains menu items corresponding to all the below mappings):

Most of the following mappings are for normal/visual mode only. The
|NERDComInsertComment| mapping is for insert mode only.

[count]<leader>cc |NERDComComment|
Comment out the current line or text selected in visual mode.


[count]<leader>cn |NERDComNestedComment|
Same as <leader>cc but forces nesting.


[count]<leader>c<space> |NERDComToggleComment|
Toggles the comment state of the selected line(s). If the topmost selected
line is commented, all selected lines are uncommented and vice versa.


[count]<leader>cm |NERDComMinimalComment|
Comments the given lines using only one set of multipart delimiters.


[count]<leader>ci |NERDComInvertComment|
Toggles the comment state of the selected line(s) individually.


[count]<leader>cs |NERDComSexyComment|
Comments out the selected lines ``sexily''


[count]<leader>cy |NERDComYankComment|
Same as <leader>cc except that the commented line(s) are yanked first.


<leader>c$ |NERDComEOLComment|
Comments the current line from the cursor to the end of line.


<leader>cA |NERDComAppendComment|
Adds comment delimiters to the end of line and goes into insert mode between
them.


|NERDComInsertComment|
Adds comment delimiters at the current cursor position and inserts between.
Disabled by default.


<leader>ca |NERDComAltDelim|
Switches to the alternative set of delimiters.


[count]<leader>cl
[count]<leader>cb??? |NERDComAlignedComment|
Same as |NERDComComment| except that the delimiters are aligned down the
left side (<leader>cl) or both sides (<leader>cb).


[count]<leader>cu |NERDComUncommentLine|
Uncomments the selected line(s).
?
install details
The NERD Commenter requires Vim 7 or higher.

Extract the plugin files in your ~/.vim (*nix) or ~/vimfiles (Windows). You
should 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 of
|'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

?

參考2:

這是一款供Vim使用的插件,看名字可以知道,它和The NERD Tree同屬一個作者。使用這款插件,你可以對多種文件類型的文件進行不同方式地、快速地注釋。這對使用Vim來寫代碼或者修改配置文件的同學來說,無疑是提升效率和快感的一件利器。你可以到這里來下載這個插件,將壓縮包里面的doc/和plugin/文件夾丟到~/.vim/下面就是安裝了。為了可以使用其幫助文檔,你還需要在Vim中執行:helptags ~/.vim/doc/來注冊。
  簡單介紹下NERD Commenter的常用鍵綁定,以C/C++文件為例,詳析的使用方法,請:h NERDCommenter。在Normal或者Visual 模式下:

??? ,ca,在可選的注釋方式之間切換,比如C/C++ 的塊注釋/* */和行注釋//
??? ,cc,注釋當前行
??? ,c,切換注釋/非注釋狀態
??? ,cs,以”性感”的方式注釋
??? ,cA,在當前行尾添加注釋符,并進入Insert模式
??? ,cu,取消注釋
??? Normal模式下,幾乎所有命令前面都可以指定行數
??? Visual模式下執行命令,會對選中的特定區塊進行注釋/反注釋

注:各命令前綴是可以自己設置的,通常是逗號’,'或者’\’.

?

轉載于:https://www.cnblogs.com/pengdonglin137/p/3356952.html

總結

以上是生活随笔為你收集整理的vim 代码注释插件的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。