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 代码注释插件相关推荐
- vim代码格式化插件clang-format
title: vim代码格式化插件clang-format date: 2017-12-12 20:28:26 tags: vim categories: 开发工具 安装vim-clang-forma ...
- html 格式化 vim,代码格式化插件
vim 版本 在.vimrc中加入以下代码 func F() exec "w" exec "r !curl -sF 'file=@%' `echo 'aHR0cDovLz ...
- 高效的vim配置及其插件管理
俗话说:"工欲善其事必先利其器!" . 同样的道理,当在linux系统中使用的vim编辑器时,我们就必须为它配置强大的插件,这样当我们使用vim时,会大大提高编写效率!好了,废话 ...
- Vim注释插件vim-commentary
在Vim中注释代码没有非常方便的快捷键,vim-commentary 提供了注释代码的操作符,它支持普通模式,可视模式,命令行模式. 普通模式 vim-commentary 所提供的注释操作符命令为 ...
- Vim代码补全插件:YouCompleteMe
Vim的代码补全一般有两种实现方案: 1. 第一种是采用ctags + OmniCppComplete ,参考:http://blog.chinaunix.net/uid-20737871-id-34 ...
- Zed-Unity插件代码注释——ZEDCamera.CS
@[toc Zed-Unity插件代码注释--ZEDCamera.cs 引言 Zed-Unity插件提供了在Unity中访问ZED相机SDK的工具,除了提供了SDK的接口外,插件里面还有一些很典型的d ...
- Zed-Unity插件中代码注释——ZEDManager.cs
文章目录 Zed Unity 插件中的代码注释 引言 ZEDManager.cs Zed Unity 插件中的代码注释 引言 Zed真是一个精品商品,提供的api的解释真的很齐全. 代码的可读性很高. ...
- C语言自动生成代码注释:koroFileHeader插件
C语言自动生成代码注释 2.配置插件 3.使用快捷键 以前写代码,只会用 //this is a add function void add(int a,int b) {return a+b; } 因 ...
- Zed-Unity插件代码注释——ZEDCommon.cs
文章目录 Zed-Unity插件代码注释--ZEDCommon.cs Update 引言 基础环境 ZEDCommon.cs脚本介绍 代码(注释后) Zed-Unity插件代码注释--ZEDCommo ...
最新文章
- Oracle数据库实例的创建、删除、修改
- Vue.js 对比其他框架
- oracle错误: ORA-00600: 内部错误代码, 参数: [kkqcscpopn_Int: 0], [], [], [], [], [], [], [], [], [], [], []...
- java内存泄露问题
- 真诚推荐7个能助你成长的前端大佬
- 我的YUV播放器MFC小笔记:右键菜单事件和非标题实现鼠标拖动
- jquery中serialize()序列化函数
- collectionutils包_CollectionUtils工具类的常用方法
- Chrome插件管理、在线离线安装方式、部分插件介绍
- DB9接口公头母头引脚区别
- 计算机控制系统与常规仪表控制系统的主要异同点,计算机控制统考试.doc
- 关于清除丢失贴图与IES文件
- 开发用的到java数组吗_java数组
- php ucenter home登录,UCenter Home 2.0 正式版现正式下载!!
- 机器学习在网络安全领域的应用(一)
- 源代码管理工具——VSS详解
- 扫描版pdf重排 linux,【Kindle Pdf Viewer中文安装教程】支持扫描版PDF重排及其他主流文件格式...
- 数学建模案例--基于微分方程的酒后驾车问题浅析
- 你的时间都去哪了?(三)时间利用情况分析报告(柳比歇夫时间统计法)
- Specification 参数的用法