介绍
autojump is a faster way to navigate your filesystem. It works by maintaining a database of the directories you use the most from the command line. Directories must be visited first before they can be jumped to.
关于autojump
有以下的站点
https://github.com/wting/autojump
https://github.com/haoziyeung/autojump
https://gitee.com/gentlecp/autojump/
https://www.worldlink.com.cn/en/osdir/autojump.html
备注:autojump 不仅可以用在 zsh
环境下,也可以在 bash
环境下使用。
安装
cd ~/.oh-my-zsh/custom/plugins/
git clone git@github.com:wting/autojump.git
cd autojump
./install.py
安装后会显示如下的结果
我们接下来只要把提示的这句加到你自己的
.bashrc
或者.zshrc
中就可以了
[[ -s /home/yanzongyuan/.autojump/etc/profile.d/autojump.sh ]] && source /home/yanzongyuan/.autojump/etc/profile.d/autojump.sh
到了这一步,我们就完成了
autojump
这个利器的安装了
autojump的使用
在shell
中直接输入autojump -h
就可以查看autojump一些参数的用法了
备注:除了直接用
autojump -h
的话,也是可以直接使用j -h
的,autojump
感觉像是在shell
中直接alias
成了j
.autojump
的命令很简单。
j -h
查看autojump
各个参数的含义j -a dir
增加一个路径到索引数据库中j -i weight
给当前目录增加索引的weight
,权重越大的话,越是容易索引到的,这个权重是根据之前进入这个路径下次数一直会累加的。也就是说你用得越多的路径,权重越大。j -d weIght
给当前目录减少索引的weight
j --purge
将当前不存在的路径从权重数据库中删除j -s
查看当前建立的权重数据库