https://github.com/jaymon/vim-commentify
Easily comment/uncomment large blocks of code in Vim
https://github.com/jaymon/vim-commentify
Last synced: 4 months ago
JSON representation
Easily comment/uncomment large blocks of code in Vim
- Host: GitHub
- URL: https://github.com/jaymon/vim-commentify
- Owner: Jaymon
- Created: 2015-06-13T07:25:58.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2025-04-16T18:00:31.000Z (about 1 year ago)
- Last Synced: 2025-10-17T09:34:42.655Z (8 months ago)
- Language: Vim Script
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Commentify
Vim Plugin to comment and un-comment lines in different source files in both normal and visual mode.
This is roughly based on the [vim comments plugin](http://www.vim.org/scripts/script.php?script_id=1528).
This plugin has been in my [.vim configuration](https://github.com/Jaymon/.vim) for a number of years and has been pretty bulletproof for me, so I figured the time was right to pull it out into its own repo.
## Why?
The comments.vim plugin was great, but it didn't support newer languages like Golang, and since Vim includes a `commentstring` variable for all the filetypes it supports, I figured I could write a plugin that commented out blocks of code using that variable instead of relying on lots of conditional statements, also, I really wanted to use the same mapping to comment/uncomment the code, and that's how Commentify was born.
## Usage
By default, Commentify maps the ctrl-c key to commenting and uncommenting.
If you wish to override that, just set `g:commentify_map_keys` to 0, then you can define
a different mapping for each of the functions in your `.vimrc`.
to map normal mode, use the `commentify` function:
commentify#Commentify()
to map visual mode, use the `RangeCommentify` function:
commentify#RangeCommentify()
## Installation
Use [pathogen](https://github.com/tpope/vim-pathogen). Clone this repo into the bundle directory.
$ cd /path/to/.vim/bundle
$ git clone git@github.com:Jaymon/vim-commentify.git commentify
## License
copyrighted by me, and distributed under the same terms as Vim, see `:help license`.