摘要:前言上一篇文章讓人相見恨晚的插件模糊查找神器概括性的介紹了的基本功能,本篇對(duì)的新功能做一下介紹??崭穹指舻拿總€(gè)子串都是對(duì)整個(gè)字符串的模糊匹配,而不是精確匹配。
前言
上一篇文章《讓人相見恨晚的vim插件:模糊查找神器LeaderF》概括性的介紹了LeaderF的基本功能,本篇對(duì)LeaderF的新功能做一下介紹。
統(tǒng)一的命令接口隨著LeaderF功能的不斷增多,LeaderF的命令也在不斷的增加,給開發(fā)和使用都帶來一些不便。于是,LeaderF提供了一個(gè)統(tǒng)一的命令接口,就像shell命令一樣,不同的命令選項(xiàng)組合,帶來不同的功能。
可以通過:Leaderf -h來查看具體使用方法。
usage: Leaderf[!] [-h] [--reverse] [--stayOpen] [--input | --cword] [--top | --bottom | --left | --right | --belowright | --aboveleft | --fullScreen] [--nameOnly | --fullPath | --fuzzy | --regexMode] [--nowrap] {file,tag,function,mru,searchHistory,cmdHistory,help,line,colorscheme,self,bufTag,buffer,rg} ... optional arguments: -h, --help show this help message and exit --reverse show results in bottom-up order --stayOpen don"t quit LeaderF after accepting an entry --input specifies INPUT as the pattern inputted in advance --cword current word under cursor is inputted in advance --top the LeaderF window is at the top of the screen --bottom the LeaderF window is at the bottom of the screen --left the LeaderF window is at the left of the screen --right the LeaderF window is at the right of the screen --belowright the LeaderF window is at the belowright of the screen --aboveleft the LeaderF window is at the aboveleft of the screen --fullScreen the LeaderF window takes up the full screen --nameOnly LeaderF is in NameOnly mode by default --fullPath LeaderF is in FullPath mode by default --fuzzy LeaderF is in Fuzzy mode by default --regexMode LeaderF is in Regex mode by default --nowrap long lines in the LeaderF window won"t wrap subcommands: {file,tag,function,mru,searchHistory,cmdHistory,help,line,colorscheme,self,bufTag,buffer,rg} file search files tag navigate tags using the tags file function navigate functions or methods in the buffer mru search most recently used files searchHistory execute the search command in the history cmdHistory execute the command in the history help navigate the help tags line search a line in the buffer colorscheme switch between colorschemes self execute the commands of itself bufTag navigate tags in the buffer buffer search buffers rg grep using rg If [!] is given, enter normal mode directly.
這樣就可以用:Leaderf
Before | Now | |
---|---|---|
:LeaderfFile | <=> | :Leaderf file |
:LeaderfBuffer | <=> | :Leaderf buffer |
:LeaderfMru | <=> | :Leaderf mru |
:LeaderfMruCwd | <=> | :Leaderf mru --cwd |
... |
每個(gè)子命令都有專有的命令選項(xiàng),可以用:Leaderf
usage: Leaderf[!] mru [-h] [--cwd] [--no-split-path] [--reverse] [--stayOpen] [--input | --cword] [--top | --bottom | --left | --right | --belowright | --aboveleft | --fullScreen] [--nameOnly | --fullPath | --fuzzy | --regexMode] [--nowrap] optional arguments: -h, --help show this help message and exit specific arguments: --cwd search MRU in current working directory --no-split-path do not split the path common arguments: --reverse show results in bottom-up order --stayOpen don"t quit LeaderF after accepting an entry --input specifies INPUT as the pattern inputted in advance --cword current word under cursor is inputted in advance --top the LeaderF window is at the top of the screen --bottom the LeaderF window is at the bottom of the screen --left the LeaderF window is at the left of the screen --right the LeaderF window is at the right of the screen --belowright the LeaderF window is at the belowright of the screen --aboveleft the LeaderF window is at the aboveleft of the screen --fullScreen the LeaderF window takes up the full screen --nameOnly LeaderF is in NameOnly mode by default --fullPath LeaderF is in FullPath mode by default --fuzzy LeaderF is in Fuzzy mode by default --regexMode LeaderF is in Regex mode by default --nowrap long lines in the LeaderF window won"t wrap If [!] is given, enter normal mode directly.自下而上顯示結(jié)果
好多從ctrlp.vim轉(zhuǎn)過來的朋友說不習(xí)慣LeaderF自上而下顯示結(jié)果的方式,想要LeaderF也能像ctrlp一樣自下而上(最優(yōu)結(jié)果在最下面)顯示結(jié)果,為了回饋各位朋友對(duì)LeaderF的支持,現(xiàn)在LeaderF也添加了自下而上顯示搜索結(jié)果的功能:
只需要在命令后面加上--reverse即可,或者也可以一勞永逸,在vimrc里面加上
let g:Lf_ReverseOrder = 1 。
LeaderF支持用空格(可以用g:Lf_AndDelimiter來修改)作為And操作符來進(jìn)行模糊匹配。當(dāng)匹配已經(jīng)匹配到字符串末尾時(shí),可以通過敲空格和一個(gè)子串來匹配字符串的前面部分,進(jìn)行快速過濾。
NOTE: 空格分隔的每個(gè)子串都是對(duì)整個(gè)字符串的模糊匹配,而不是精確匹配。
可以通過上下鍵來翻看模糊匹配歷史:
LeaderF精益求精,永無止境。
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/25050.html
摘要:是什么是一個(gè)用寫的插件,可以在成千上萬數(shù)十萬個(gè)文件中,通過模糊查找的方式,快速找到目標(biāo)文件。它還有很多衍生功能快速打開或定位某個(gè)最近使用的文件包括函數(shù)類變量等命令歷史文件中的某一行的等等。友情鏈接,也許是最好的模糊查詢插件 提到vim的模糊查找插件,很多人第一反應(yīng)是ctrlp.vim,ctrlp知名度很高,但跟其它的同類插件相比,它的唯一優(yōu)點(diǎn)是用vimL編寫(這讓它的性能是所有同類插件...
摘要:也就是,是一個(gè)非常強(qiáng)大的源碼符號(hào)索引工具。韋大的中符號(hào)索引篇對(duì)有比較詳細(xì)的介紹,本文再做一些補(bǔ)充。的最新版本已經(jīng)是,該版本了韋大文中提到的下面文件名大小寫的。 Gtags Gtags也就是GNU GLOBAL,是一個(gè)非常強(qiáng)大的源碼符號(hào)索引工具。它通過建立索引數(shù)據(jù)庫,不但可以查找函數(shù)的定義,還可以查找函數(shù)的所有引用(被調(diào)用的地方);而且它還可以增量地更新索引數(shù)據(jù)庫,當(dāng)代碼有所改變時(shí),它可...
摘要:比如,由于的一些命令,比如默認(rèn)是在當(dāng)前目錄下進(jìn)行,實(shí)際就變成了在項(xiàng)目根目錄下搜索。如果使用,那么也是必不可少。比如一個(gè)比較實(shí)用的就是用查找當(dāng)前光標(biāo)下的詞。今天就先講這么多了,下一篇可能更多講講如何配置更美觀的一些小細(xì)節(jié)。 我學(xué)習(xí)計(jì)算機(jī)不久就開始用了 vim,到現(xiàn)在也三四年了,且算是對(duì) vim 有了一定的控制力。在這里分享一下使用過程中的一些心路歷程,說實(shí)話,要留意的小地方有很多,但是由...
摘要:比如下表是它可用的所有選項(xiàng)是一個(gè)函數(shù),用來創(chuàng)建自己的自動(dòng)補(bǔ)全功能。如果第一個(gè)參數(shù)是一個(gè)命令字符或一個(gè)那么它會(huì)被用作對(duì)于高級(jí)用戶,可以傳入一個(gè)字典選項(xiàng)。希望大家可以結(jié)合創(chuàng)造出更多的使用方法。 FZF and VIM 前言 fzf本身并不是一個(gè)vim 插件,本來作者只提供了基本的wrapper函數(shù)(比如fzf#run). 但后來作者發(fā)現(xiàn)很多人并不熟悉VIMScript, 所以就創(chuàng)建一個(gè)默認(rèn)...
閱讀 2286·2023-04-26 01:50
閱讀 733·2021-09-22 15:20
閱讀 2612·2019-08-30 15:53
閱讀 1614·2019-08-30 12:49
閱讀 1734·2019-08-26 14:05
閱讀 2732·2019-08-26 11:42
閱讀 2327·2019-08-26 10:40
閱讀 2630·2019-08-26 10:38