samer@3: # commentary.vim samer@3: samer@3: Comment stuff out. Use `gcc` to comment out a line (takes a count), samer@3: `gc` to comment out the target of a motion (for example, `gcap` to samer@3: comment out a paragraph), `gc` in visual mode to comment out the selection, samer@3: and `gc` in operator pending mode to target a comment. You can also use samer@3: it as a command, either with a range like `:7,17Commentary`, or as part of a samer@3: `:global` invocation like with `:g/TODO/Commentary`. That's it. samer@3: samer@3: I wrote this because 5 years after Vim added support for mapping an samer@3: operator, I still couldn't find a commenting plugin that leveraged that samer@3: feature (I overlooked samer@3: [tcomment.vim](https://github.com/tomtom/tcomment_vim)). Striving for samer@3: minimalism, it weighs in at under 100 lines of code. samer@3: samer@3: Oh, and it uncomments, too. The above maps actually toggle, and `gcgc` samer@3: uncomments a set of adjacent commented lines. samer@3: samer@3: ## Installation samer@3: samer@3: If you don't have a preferred installation method, I recommend samer@3: installing [pathogen.vim](https://github.com/tpope/vim-pathogen), and samer@3: then simply copy and paste: samer@3: samer@3: cd ~/.vim/bundle samer@3: git clone git://github.com/tpope/vim-commentary.git samer@3: samer@3: Once help tags have been generated, you can view the manual with samer@3: `:help commentary`. samer@3: samer@3: ## FAQ samer@3: samer@3: > My favorite file type isn't supported! samer@3: samer@3: Relax! You just have to adjust `'commentstring'`: samer@3: samer@3: autocmd FileType apache set commentstring=#\ %s samer@3: samer@3: ## Self-Promotion samer@3: samer@3: Like commentary.vim? Follow the repository on samer@3: [GitHub](https://github.com/tpope/vim-commentary) and vote for it on samer@3: [vim.org](http://www.vim.org/scripts/script.php?script_id=3695). And if samer@3: you're feeling especially charitable, follow [tpope](http://tpo.pe/) on samer@3: [Twitter](http://twitter.com/tpope) and samer@3: [GitHub](https://github.com/tpope). samer@3: samer@3: ## License samer@3: samer@3: Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. samer@3: See `:help license`.