參考Vim插件推薦--模糊搜索神器fzf介紹及在Vim中的使用 | vim教程網 (vimjc.com)
junegunn/fzf: A command-line fuzzy finder (github.com)
使用pathegon進行管理,方法為
具體方法為:將倉庫git clone到\plugins目錄下,在fzf目錄下執行命令
系統中安裝完 fzf 后便可以在Vim命令行模式使用 :FZF
來列出當前目錄下所有的文件,可以通過 Ctrl-k
或 Ctrl-j
來上下移動選擇目標文件,也可以使用鍵盤上下鍵來進行選擇目標文件
oops,還需要裝一下這個
junegunn/fzf.vim: fzf vim (github.com)
vim下支持的命令
這些命令都是FZF調用某個工具產生文件,文件內容, tag, comment, command,然后FZF用一個小窗口把它們顯示出來,用戶就可以用模糊搜索的方式來選擇一個或多個選項,按下enter鍵后就可以用VIM打開它們或跳轉到相應的行。
如Files針對的就是文件, GFiles針對的就是git文件
Command | List |
---|---|
Files [PATH] |
普通文件查找 (similar to :FZF ) |
GFiles [OPTS] |
git文件查找 (git ls-files ) |
GFiles? |
git文件查找 (git status ) |
Buffers |
buffer文件切換 |
Colors |
Color schemes |
Ag [PATTERN] |
ag search result (ALT-A to select all, ALT-D to deselect all) |
Lines [QUERY] |
加載的所有buffer里查找 |
BLines [QUERY] |
在當前buffer里查找包含某關鍵詞的行 |
Tags [QUERY] |
以Tag查找 (ctags -R ) |
BTags [QUERY] |
Tags in the current buffer |
Marks |
Marks |
Windows |
Windows |
Locate PATTERN |
locate command output |
History |
v:oldfiles and open buffers |
History: |
命令歷史查找 |
History/ |
Search history |
Snippets |
Snippets (UltiSnips) |
Commits |
Git commits (requires fugitive.vim) |
BCommits |
Git commits for the current buffer |
Commands |
Commands |
Maps |
Normal mode mappings |
Helptags |
Help tags 1 |
Filetypes |
File types |