Neovim 配置——注释
Neovim 提供内置支持,详见 :h commenting
和 Neovim now has built-in commenting : r/neovim。
但是只能支持行注释,无法支持块注释。块注释通过插件 numToStr/Comment.nvim 实现。
-
Neovim 内置
vim.opt.commentstring
来设置注释格式。常见的文件格式已经由该插件设置好了。其他类似控制插件可见 folke/ts-comments.nvim: Tiny plugin to enhance Neovim's native comments。 -
当需要在一个文件中不同区域插入不同文件格式的注释,比如 Vue 文件中同时有
html
、css
和javascript
时,可见插件 JoosepAlviste/nvim-ts-context-commentstring 和 numToStr/Comment.nvim。 -
其他插件有