-
Notifications
You must be signed in to change notification settings - Fork 8
Vim text objects for comments
glts/vim-textobj-comment
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
textobj-comment --------------- BETA Please report any issues on the issue tracker. This Vim plugin provides text objects to select comments. "ac" selects a comment including the comment delimiters, "ic" selects the comment content without the delimiters. A third text object, "aC", selects a "big" comment, including trailing or leading whitespace. textobj-comment uses the filetype-specific 'comments' setting to determine what a comment looks like for a given language. It should thus automatically work for most languages supported by Vim. The plugin handles any number of single and opening/closing delimiters, for both full-line and inline/ end-of-line comments. In order to find a target, textobj-comment looks for a comment under the cursor, in or at the end of the cursor line, and above the cursor line. This plugin depends on the textobj-user plugin, version 0.4.0. https://github.com/kana/vim-textobj-user Installation ------------ Move the files into their respective directories inside your ~/.vim directory (or your $HOME\vimfiles directory if you're on Windows). With the Pathogen plugin manager the installation is as simple as: cd ~/.vim/bundle git clone git://github.com/glts/vim-textobj-comment.git textobj-comment But this plugin also plays well with the built-in GetLatestVimScripts and other plugin managers such as Vundle, vim-addon-manager, and vim-flavor. Development ----------- If you are interested in working on the code, use the test suite to make sure you don't break anything. The test suite is written using vspec, version 1.1.0. https://github.com/kana/vim-vspec Use "make test" to run the whole suite, and "make t/<test>.vim" to run a specific test. You may need to adapt the paths to the vspec executable and to the runtime path directories at the top of the Makefile.