-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FZF integration #19
Comments
Just finding this plugin. I also think the fzf integration is a great idea. I was able to simplify it to one function and it seems to work great for me. function! s:fzf_miniyank(put_before, fullscreen) abort
function! Sink(opt, line) abort
let l:key = substitute(a:line, ' .*', '', '')
if empty(a:line) | return | endif
let l:yanks = miniyank#read()[l:key]
call miniyank#drop(l:yanks, a:opt)
endfunction
let l:put_action = a:put_before ? 'P' : 'p'
let l:name = a:put_before ? 'YanksBefore' : 'YanksAfter'
let l:spec = {}
let l:spec['source'] = map(miniyank#read(), {k,v -> k.' '.join(v[0], '\n')})
let l:spec['sink'] = {val -> Sink(l:put_action, val)}
let l:spec['options'] = '--no-sort --prompt="Yanks-'.l:put_action.'> "'
call fzf#run(fzf#wrap(l:name, l:spec, a:fullscreen))
endfunction
command! -bang YanksBefore call s:fzf_miniyank(1, <bang>0)
command! -bang YanksAfter call s:fzf_miniyank(0, <bang>0)
map <A-p> :YanksAfter<CR>
map <A-P> :YanksBefore<CR> |
First of all, thanks for the code snippets! I've used this for awhile now, but I noticed one issue that started happening. If I used either Simply changing |
Hello, i created simple FZF integration!
Maybe you can improve my code and add to this awesome plugin =)
The text was updated successfully, but these errors were encountered: