tab-to-find
One tab enables interactive and dynamic search for everything!!
It also supports tab dynamic completion of commands for the paths of any directories and files.
It is extremely useful for people who often need to find files and are troubled by entering very long paths. There is no need to type the paths one by one slowly. You can search and reach the target in one step. Even if there are millions of files, it is still very smooth and not laggy at all.
Abbreviation: TTF
Demo
features
- Just press tab as usual.
- Without entering anything, tab can directly and dynamically search for all directories and files in the current directory and its subdirectories. It’s also very useful just as a search tool.
- Use tab to autocomplete.
- It doesn’t necessarily have to be an exact match at the beginning. For example, if you enter
doc
and then press tab, it can matchtest_doc
,doc_test
, andtest_doc_test
. - It can recursively match all files/directories with
doc
in the subdirectories of the current directory. That means you can entercd doc
in thehome
directory and directlycd
from thehome
directory to~/github/test - proj/documents
in one step!- If there is only one match, it will be automatically completed.
- For example, if it matches
Documents/
, but if that’s not what you want and you want~/github/test - proj/documents
, you can press tab again.
- For example, if it matches
- If there is more than one match, it will recursively search all folders containing
doc
in the subdirectories.
- If there is only one match, it will be automatically completed.
- If what follows
cd
is not a directory, it will automatically enter the directory where that file is located. For example, if you entercd ~/github/test.txt
, it can directly enter the~/github
folder. - If the input ends with
//
, it can search only for folders in one level of the directory, instead of recursively searching all subdirectories. - If the input ends with
..
, it can search only for files in one level of the directory, instead of recursively searching all subdirectories. - The same applies to other commands such as
vi
,ln
,mv
,cp
, etc.
- It doesn’t necessarily have to be an exact match at the beginning. For example, if you enter
Usage
- Press tab to search everything
- Press tab for completion as usual
安装方法
- 先安装fd, 按照 fd的安装方法 安装一下就行(一般来说就是一行命令就搞定), 不用额外配置
- 再安装fzf, 按照 fzf的安装方法 安装一下就行(一般来说就是一行命令就搞定), 不用额外配置
- 然后再按照下方的手动方式 或者 走Oh-My-Zsh方式的方式来安装
tab-to-find
就可以了
手动方式
先克隆一波这个项目
1 | git clone https://github.com/no5ix/tab-to-find ~/somewhere |
然后把下面这行加到你的 ~/.zshrc
.
1 | source ~/somewhere/tab-to-find.plugin.zsh |
OhMyZsh方式
执行下面这行命令
1 | git clone https://github.com/no5ix/tab-to-find ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/tab-to-find |
- 然后
vim ~/.zshrc
, 找到七八十行左右plugins=(git)
的位置 比如原来是plugins=(git)
则改为plugins=(git tab-to-find)
source ~/.zshrc
或者重启 zsh
Installation
- Install fd by following its installation instruction.
- Install fzf by following its installation instruction.
- then install
tab-to-find
by following Manual or Oh-My-Zsh below
Manual
clone this repository.
1 | git clone https://github.com/no5ix/tab-to-find ~/somewhere |
Then add the following line to your ~/.zshrc
.
1 | source ~/somewhere/tab-to-find.plugin.zsh |
OhMyZsh
Clone this repository to your custom directory and then add tab-to-find
to your plugin list.
1 | git clone https://github.com/no5ix/tab-to-find ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/tab-to-find |