2021-07-11 03:16:57 +00:00
|
|
|
if !has('nvim-0.5')
|
|
|
|
echohl Error
|
|
|
|
echomsg "Fzf-lua is only available for Neovim versions 0.5 and above"
|
|
|
|
echohl clear
|
|
|
|
finish
|
|
|
|
endif
|
2021-08-05 16:34:27 +00:00
|
|
|
|
|
|
|
if exists('g:loaded_fzf_lua') | finish | endif
|
|
|
|
let g:loaded_fzf_lua = 1
|
|
|
|
|
|
|
|
" FzfLua builtin lists
|
|
|
|
function! s:fzflua_complete(arg,line,pos)
|
2022-01-17 00:32:51 +00:00
|
|
|
let l:builtin_list = luaeval('vim.tbl_filter(
|
|
|
|
\ function(k)
|
|
|
|
\ if require("fzf-lua")._excluded_metamap[k] then
|
|
|
|
\ return false
|
|
|
|
\ end
|
|
|
|
\ return true
|
|
|
|
\ end,
|
|
|
|
\ vim.tbl_keys(require("fzf-lua")))')
|
2021-08-05 16:34:27 +00:00
|
|
|
|
|
|
|
let list = [l:builtin_list]
|
|
|
|
let l = split(a:line[:a:pos-1], '\%(\%(\%(^\|[^\\]\)\\\)\@<!\s\)\+', 1)
|
|
|
|
let n = len(l) - index(l, 'FzfLua') - 2
|
|
|
|
|
|
|
|
return join(list[0],"\n")
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
" FzfLua commands with auto-complete
|
|
|
|
command! -nargs=* -complete=custom,s:fzflua_complete FzfLua lua require('fzf-lua.cmd').load_command(<f-args>)
|