Skip to content

Commit 6ef78d5

Browse files
committed
Treat search result as text object
1 parent f78df37 commit 6ef78d5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: .vimrc

+8
Original file line numberDiff line numberDiff line change
@@ -251,3 +251,11 @@ function! RenameFile()
251251
endif
252252
endfunction
253253
map <leader>n :call RenameFile()<cr>
254+
255+
256+
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
257+
" Make a simple "search" text object http://vim.wikia.com/wiki/Copy_or_change_search_hit
258+
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
259+
vnoremap <silent> s //e<C-r>=&selection=='exclusive'?'+1':''<CR><CR>
260+
\:<C-u>call histdel('search',-1)<Bar>let @/=histget('search',-1)<CR>gv
261+
omap s :normal vs<CR>

0 commit comments

Comments
 (0)