A Vim plugin that toggles the visibility of comments in your code using Vim's conceal feature.
- Toggle visibility of single-line and multi-line comments with a single command.
- Supports common programming languages like C, C++, and Python.
- Uses Vim's native conceal feature to hide comments without altering the file content.
You can install vim-hidecomments
using your favorite plugin manager or manually by placing the files in your .vim
directory.
Using Vim-Plug
-
Add the following to your
.vimrc
:Plug 'wangfanstar/vim-hidecomments'
-
Run
:PlugInstall
in Vim.
Using Pathogen
-
Clone this repository into your
.vim/bundle
directory:git clone https://github.com/wangfanstar/vim-hidecomments.git ~/.vim/bundle/vim-hidecomments
-
Run
:Helptags
in Vim to regenerate help tags.
-
Download the plugin files and copy them to your
.vim
directory. -
Make sure the following lines are in your
.vimrc
:filetype plugin on
To toggle the visibility of comments in the current buffer, use the following command in normal mode:
:HideComments
No configuration is required to use this plugin. However, you can map the :HideComments command to a keyboard shortcut in your .vimrc for convenience:
nmap <Leader>hc :HideComments<CR>
Replace hc with your preferred key combination.
License This plugin is released under the MIT License. See LICENSE file for more details.