前言
本文介绍自《vim 的模糊查找插件 LeaderF 新功能介绍》以后,LeaderF增加的一些新的功能。
异步grep Leaderf rg
此功能已经在《vim的grep插件Leaderf rg:grep和模糊匹配的完美结合》做了介绍。
补充一点:应很多用户的要求,现在支持使用Leaderf rg {pattern}
来搜索了,不必使用Leaderf rg -e {pattern}
了。当然,如果想指定多个pattern,还是需要加上-e
, 比如:Leaderf rg -e foo -e bar
。
使用gtags导航 Leaderf gtags
此功能已经在《Leaderf gtags:模糊匹配与最强静态符号索引工具的完美结合
》做了介绍。
增强使用vimL给LeaderF写扩展的功能
此前只可以为vim写,现在也可以为neovim写了。
具体内容参见:https://github.com/Yggdroot/LeaderF/issues/144#issuecomment-540008950
Leaderf {cmd} --recall
这个命令是在LeaderF窗口关闭的情况下,召回最后的搜索结果,{cmd}
可以是LeaderF目前支持的所有命令,像 file, mru, rg, gtags 等。例如:使用 Leaderf file --recall

Leaderf --recall
是召回上一个命令的最后搜索结果。例如,刚使用完Leaderf file
,执行Leaderf --recall
相当于执行Leaderf file --recall
, 刚使用完Leaderf rg -e foo
, 执行Leaderf --recall
相当于执行Leaderf rg --recall
。

Leaderf file
根据当前buffer名字查询文件
打开Leaderf file
时,如果没有输入任何查询字符,文件列表会按照最匹配当前buffer路径名字来排序。这在某些场景比较有用,比如当前buffer名字是foo.go
,想切换到foo_test.go
。

Leaderf file
在搜索结果中不显示当前buffer的名字
只要 let g:Lf_IgnoreCurrentBufferName = 1
,缺省会显示。
使用popup window / floating window 预览
let g:Lf_PreviewInPopup = 1
就可以启用这个功能,缺省未启用。 g:Lf_PreviewHorizontalPosition
指定 popup window / floating window 的位置。 g:Lf_PreviewPopupWidth
指定 popup window / floating window 的宽度。

