mac下安装autojump

最近安装了iTerm,被小伙伴推荐了一个插件autojump,感受真是又好看又好用啊!默认的主题已经很好用了!在此分享给你们~javascript

看图解释:java

 

一行命令就能够直接搜索曾经打开过的文件夹,Project是文件夹的名字,如此清楚,简直不能更美好~git

1,安装zsh,执行
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 
2,将zsh设置为默认的shell:
chsh -s /bin/zsh (重启shell)
3,查看当前默认是哪一个shell(bash or zsh)
echo $SHELL 
4,安装autojump(确保有brew)
brew install autojump
5,安装了zsh以后会默认有一个文件.zshrc,能够打开终端而且ls -a查看,使用vim .zshrc打开.zshrc
6,点击i编辑文件
(1).在文件中搜索“plugins=”,
  • 若是有修改成:plugins=(git autojump);
  • 若是没有就在文件第一行写plugins=(git autojump);
(2).而后在新的一行添加写:
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh

(3).而后在新的一行添加写:

alias code="'/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code'"github

alias gs="git status "shell

alias gc="git add . && git commit -am "vim

(4).保存更改后的配置文件,而且:wq保存退出。
7,而后执行    source .zshrc ,autojump就能够直接使用啦~
8.具体使用方法有两种:
(1)添加一条快捷键设置:
code . 会直接打开vsCode

简写 gs, gc
(2)直接输入 j project

也会自动定位到曾经去过的project目录文件夹下,此时的目录必定不能写错!bash

(3)打开当前路径下的文件的快捷键 ‘o’app

前提请配置一下curl

alias o="ofd"ui

 

plugins=(git osx)

//plugins=(git osx autojump)//[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh

相关文章
相关标签/搜索