Skip to content

Commit

Permalink
Treat search result as text object
Browse files Browse the repository at this point in the history
  • Loading branch information
eeeschwartz committed May 13, 2014
1 parent f78df37 commit 6ef78d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -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.