Added visual remap commands to find selection in visual mode.
[profile.git] / .vimrc
diff --git a/.vimrc b/.vimrc
index 4c10a31..5c3d17e 100755 (executable)
--- a/.vimrc
+++ b/.vimrc
@@ -86,6 +86,10 @@ map = yyp:s/./=/g<RETURN>:let @/=''<RETURN>:<RETURN>
 command! W :w
 se tags=~/.ctags
 
+" Make * and # work the way you expect in visual mode.
+vnoremap * y/\V<C-R>=substitute(escape(@@,"/\\"),"\n","\\\\n","ge")<CR><CR>
+vnoremap # y?\V<C-R>=substitute(escape(@@,"?\\"),"\n","\\\\n","ge")<CR><CR>
+
 fun! Invert_Case()
   let &ic = ! &ic
 endfun