Permalink
Browse files

Treat search result as text object

  • Loading branch information...
eeeschwartz committed May 13, 2014
1 parent f78df37 commit 6ef78d524627211daa00d518266c658199a115c8
Showing with 8 additions and 0 deletions.
  1. +8 −0 .vimrc
View
8 .vimrc
@@ -251,3 +251,11 @@ function! RenameFile()
endif
endfunction
map <leader>n :call RenameFile()<cr>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Make a simple "search" text object http://vim.wikia.com/wiki/Copy_or_change_search_hit
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
vnoremap <silent> s //e<C-r>=&selection=='exclusive'?'+1':''<CR><CR>
\:<C-u>call histdel('search',-1)<Bar>let @/=histget('search',-1)<CR>gv
omap s :normal vs<CR>

0 comments on commit 6ef78d5

Please sign in to comment.