Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tpope/vim-commentary
commentary.vim: comment stuff out
https://github.com/tpope/vim-commentary
Last synced: 12 days ago
JSON representation
commentary.vim: comment stuff out
- Host: GitHub
- URL: https://github.com/tpope/vim-commentary
- Owner: tpope
- Created: 2011-08-20T06:36:14.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2024-10-22T02:05:39.000Z (about 2 months ago)
- Last Synced: 2024-10-22T03:34:06.758Z (about 2 months ago)
- Language: Vim Script
- Homepage: http://www.vim.org/scripts/script.php?script_id=3695
- Size: 33.2 KB
- Stars: 5,876
- Watchers: 61
- Forks: 214
- Open Issues: 31
-
Metadata Files:
- Readme: README.markdown
- Contributing: CONTRIBUTING.markdown
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
- my-awesome-github-stars - tpope/vim-commentary - commentary.vim: comment stuff out (Vim Script)
README
# commentary.vim
Comment stuff out. Use `gcc` to comment out a line (takes a count),
`gc` to comment out the target of a motion (for example, `gcap` to
comment out a paragraph), `gc` in visual mode to comment out the selection,
and `gc` in operator pending mode to target a comment. You can also use
it as a command, either with a range like `:7,17Commentary`, or as part of a
`:global` invocation like with `:g/TODO/Commentary`. That's it.I wrote this because 5 years after Vim added support for mapping an
operator, I still couldn't find a commenting plugin that leveraged that
feature (I overlooked
[tcomment.vim](https://github.com/tomtom/tcomment_vim)). Striving for
minimalism, it weighs in at under 100 lines of code.Oh, and it uncomments, too. The above maps actually toggle, and `gcgc`
uncomments a set of adjacent commented lines.## Installation
Install using your favorite package manager, or use Vim's built-in package
support:mkdir -p ~/.vim/pack/tpope/start
cd ~/.vim/pack/tpope/start
git clone https://tpope.io/vim/commentary.git
vim -u NONE -c "helptags commentary/doc" -c qMake sure this line is in your vimrc, if it isn't already:
filetype plugin indent on
## FAQ
> My favorite file type isn't supported!
Relax! You just have to adjust `'commentstring'`:
autocmd FileType apache setlocal commentstring=#\ %s
## Self-Promotion
Like commentary.vim? Follow the repository on
[GitHub](https://github.com/tpope/vim-commentary) and vote for it on
[vim.org](http://www.vim.org/scripts/script.php?script_id=3695). And if
you're feeling especially charitable, follow [tpope](http://tpo.pe/) on
[Twitter](http://twitter.com/tpope) and
[GitHub](https://github.com/tpope).## License
Copyright (c) Tim Pope. Distributed under the same terms as Vim itself.
See `:help license`.