Created
May 6, 2011 03:51
-
-
Save ConradIrwin/958421 to your computer and use it in GitHub Desktop.
Revisions
-
ConradIrwin created this gist
May 6, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ function! SelectComment() let curindent = indent(".") " bail if not a comment if getline(".")[curindent] != "#" return endif " find the first commented line while line(".") - 1 && indent(line(".") - 1) == curindent && getline(line(".") - 1)[curindent] == "#" normal k endwhile " start selecting normal V " find the last commented line while line(".") < line("$") && indent(line(".") + 1) == curindent && getline(line(".") + 1)[curindent] == "#" normal j endwhile endfunction vnoremap ic :<C-U>silent! call SelectComment()<CR> omap ic :normal vic<CR>