Skip to content

Instantly share code, notes, and snippets.

@yuki-yano
Created July 21, 2020 03:25
Show Gist options
  • Select an option

  • Save yuki-yano/b6d0ad4eb21038d09cd3986921685570 to your computer and use it in GitHub Desktop.

Select an option

Save yuki-yano/b6d0ad4eb21038d09cd3986921685570 to your computer and use it in GitHub Desktop.
fzf command line completion
function! s:hoge() abort
let cl = getcmdline()
function! s:sink(line) abort closure
call feedkeys(":" .. cl .. a:line, "n")
endfunction
function! s:run(...) abort closure
call fzf#run({'source': 'ls -1', 'sink': funcref("s:sink")})
endfunction
call timer_start(0, funcref("s:run"))
redraw
return "\<C-c>"
endfunction
cnoremap <expr> <Tab> <SID>hoge()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment