使用vi编辑器轻松(取消)注释源代码
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用vi编辑器轻松(取消)注释源代码相关的知识,希望对你有一定的参考价值。
#Put into your .vimrc file#The commands to comment a selection of text are as follows, begining with begining-of-line comments:
,# shell, perl, etc
,/ c
,> email quote
," vim
,% latex, prolog
,! assembly?... add single !
,; scheme
,- don't remember this one... add --
,c clears any of the previous comments
Here are the wrapping comments, each line wrapped individually:
,* c
,( Standard ML
,< html
,d clears any of the wrapping comments
#" lhs comments map ,# :s/^/#/<CR> map ,/ :s/^////<CR> map ,> :s/^/> /<CR> map ," :s/^/"/<CR> map ,% :s/^/%/<CR> map ,! :s/^/!/<CR> map ,; :s/^/;/<CR> map ,- :s/^/--/<CR> map ,c :s/^//\|^--\|^> \|^[#"%!;]//<CR> #" wrapping comments map ,* :s/^(.*)$//* 1 *//<CR> map ,( :s/^(.*)$/(* 1 *)/<CR> map ,< :s/^(.*)$/<!-- 1 -->/<CR> map ,d :s/^([/(]*\|<!--) (.*) (*[/)]\|-->)$/2/<CR>
以上是关于使用vi编辑器轻松(取消)注释源代码的主要内容,如果未能解决你的问题,请参考以下文章