如何在vimrc(Vim配置)文件中进行注释?

作为一个高级文本编辑器,Vim有很多配置选项。这些配置选项可以临时或永久地以不同的方式应用。vimrc配置文件用于永久Vim配置。在将配置放入vimrc文件时,我们可能需要编写一些注释来解释给定的配置。

null

vimrc(Vim配置)文件中的单行注释

vimrc或Vim配置文件使用双引号表示单行注释。行开头的单引号将使此行成为注释,而不是解释为配置。如果单引号不在行的开头,它将被解释为配置。

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
  syntax on
endif

另外,注释在下面的vimrc文件中突出显示,这与常规配置行不同。

图片[1]-如何在vimrc(Vim配置)文件中进行注释?-yiteyi-C++库

vimrc(Vim配置)文件中的多行注释

多行注释与单行注释相同。像下面这样一行接一行地排好。

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
  syntax on
endif
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.

相关文章: 如何使用curl命令发送/设置HTTP头?

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享