Closed giceli closed 1 year ago
Sorry, I don't understand what you are intended to do. What maps?
for example,
if i use a variables ' Lf_Projects' to records all the project i have edited, I can use Leaderf to see the project i have edited before, i want to map '
thanks, it works, but i find that, it only works when g:Lf_WindowPosition != 'popup'
Yes, only works for non-popup mode.
Now g:Lf_NormalCommandMap is available. https://github.com/Yggdroot/LeaderF/blob/3ded37f92807d8c6ad831d5af2c4ff22bfd32fc8/doc/leaderf.txt#L523-L553
vim or neovim?
Output of
vim --version
ornvim --version
:Output of
:echo has("python")
:0
Output of
:echo has("python3")
:1
Output of
:echo &pythondll
(only vim, not neovim):libpython2.7.so.1.0
Output of
:echo &pythonthreedll
(only vim, not neovim):libpython3.6m.so.1.0
Output of
:py print(sys.version)
:E836: 此 Vim 无法在使用了 :py3 之后执行 :python E263: 抱歉,此命令不可用,无法加载 Python 库。
Output of
:py3 print(sys.version)
:[GCC 8.4.0]
Output of
:echo g:Lf_Debug_Cmd
:E121: 未定义的变量: g:Lf_Debug_Cmd
Output of
:echo g:Lf_FilesFromCache
:E121: 未定义的变量: g:Lf_FilesFromCache
Operating system:
Configurations related to LeaderF in vimrc:
let g:Lf_HideHelp = 1 let g:Lf_WindowPosition = 'popup' let g:Lf_PreviewInPopup = 1 let g:Lf_StlSeparator = { \ 'left': "\ue0b0", \ 'right': "\ue0b2", \ 'font': "DejaVu Sans Mono for Powerline" \ }
" insert mode " c-v vertical " c-s split " c-x select let g:Lf_CommandMap = {'<c-]>' : [''],
\ '' : [''],
\ '' : [''],
\ }
let g:Lf_UseCache = 0 let g:Lf_UseVersionControlTool = 0
let g:Lf_DefaultExternalTool = "rg"
let g:Lf_WildIgnore = { \ 'dir' : ['.svn', '.git', '.hg', '.vscode', '.clangd'], \ 'file': ['.so', ".o", ".py[co]", ".exe", "*.bak"] \ }
let g:Lf_Extensions = get(g:,'Lf_Extensions',{})
" for asynctasks function! s:lf_asynctask_sourcebase(atype = "") let rows = asynctasks#source(&columns * 48 / 100) let globalsource = [] let localsource = [] let scriptsource = [] let othersource = [] for row in rows let name = substitute(row[0],""," ","g") if split(name," ")[0] == a:atype || a:atype == "" if row[1][1:5] == "local" let localsource += [name . ' ' . row[1] . ' : ' . row[2]] elseif row[1][1:6] == "global" let globalsource += [name . ' ' . row[1] . ' : --' . row[2][20:]] elseif row[1][1:6] == "script" let scriptsource += [name . ' ' . row[1] . ' : ' . row[2]] else let othersource += [name . ' ' . row[1] . ' : ' . row[2]] endif endif endfor return localsource + globalsource + scriptsource + othersource endfunction
function! s:lf_asynctask_source_all(...) return s:lf_asynctask_source_base() endfunction function! s:lf_asynctask_source_run(...) return s:lf_asynctask_source_base("run") endfunction function! s:lf_asynctask_source_build(...) return s:lf_asynctask_source_base("build") endfunction
function! s:lf_asynctaskaccept(line, arg) let pos = stridx(a:line, '<') if pos < 0 return endif let name = strpart(a:line, 0, pos) let name = substitute(name, '^\s(.{-})\s$', '\1', '') let name = substitute(name, ' ', '', 'g') if name != '' exec "AsyncTask " . name endif endfunction function! s:lf_task_digest(line, mode) let pos = stridx(a:line, '<') if pos < 0 return [a:line, 0] endif let name = strpart(a:line, 0, pos-1) return [name,0] endfunction
function LfAddAsyncTask(name,sourceFunction,acceptFunction,digestFunction) let g:Lf_Extensions[a:name] = { \ 'source': string(function(a:sourceFunction))[10:-3], \ 'accept': string(function(a:acceptFunction))[10:-3], \ 'get_digest': string(function(a:digestFunction))[10:-3], \ 'highlights_def': { \ 'Lf_hl_funcScope': '^\zs.\ze<', \ 'Lf_hl_funcDirname': '^.\zs<.>\ze.', \ }, \ 'help' : 'navigate available tasks from asynctasks.vim', \ } endfunction
call LfAddAsyncTask("asynctaskAll","s:lf_asynctask_source_all","s:lf_asynctask_accept","s:lf_task_digest") call LfAddAsyncTask("asynctaskRun","s:lf_asynctask_source_run","s:lf_asynctask_accept","s:lf_task_digest") call LfAddAsyncTask("asynctaskBuild","s:lf_asynctask_source_build","s:lf_asynctask_accept","s:lf_task_digest")