vim 的模糊查找插件 LeaderF 新功能介绍(二)

2019-10-28 18:10:03 +08:00
 Yggdroot

前言

本文介绍自《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 的宽度。

3285 次点击
所在节点    Vim
3 条回复
jdhao
2019-10-29 16:23:38 +08:00
资瓷大佬!
Yggdroot
2019-10-29 16:25:08 +08:00
@jdhao 谢谢。
x1314aq
2019-11-09 14:25:10 +08:00
支持,一直在用的插件,越来越好用了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/613750

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX