Last active
December 12, 2018 10:10
-
-
Save jhbabon/553026dfd861e9377c84c418ca829f4d to your computer and use it in GitHub Desktop.
scout.vim visual selection
This file contains 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 characters
" see: http://vimcasts.org/episodes/search-for-the-selected-text/ | |
function! s:VScoutSearch(cmdtype) | |
let temp = @s | |
norm! gv"sy | |
let s:selection = @s | |
let @s = temp | |
if a:cmdtype == 'files' | |
call scout#files#run({ 'search': s:selection }) | |
endif | |
if a:cmdtype == 'buffers' | |
call scout#buffers#run({ 'search': s:selection }) | |
endif | |
endfunction | |
xnoremap <leader>fw :<C-u>call <SID>VScoutSearch('files')<CR> | |
xnoremap <leader>bw :<C-u>call <SID>VScoutSearch('buffers')<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment