LoginSignup
11
12

More than 5 years have passed since last update.

autojumpでディレクトリ移動を効率化する

Posted at

About autojump

カレントディレクトリに縛られずに最近移動したディレクトリを指定して移動することが出来る。

Railsのようなディレクトリ構成が地味に複雑なフレームワークを利用するときなどとても便利。
コマンドラインで新しいセッションを開いた時に既に開いているセッションのカレントディレクトリに一発で移動できたりするのも超絶便利。

HowTo

既にapp, controller, viewというディレクトリに移動したとして、カレントディレクトリに関係なく

$ j con [Tab] # Tabを押すことでcontorollerが補完される

でそのディレクトリに移動できる。

現在移動できるディレクトリ一覧はこれで見られる。

$ j -s

Installing

MacPortsの場合

(多分Homeblewの場合も同様)

sudo port install autojump

途中で以下のスクリプトを.zshrcに追加するような支持が出るのでそのようにする。

export FPATH="$FPATH:/opt/local/share/zsh/site-functions/"
if [ -f /opt/local/etc/profile.d/autojump.zsh ]; then
    . /opt/local/etc/profile.d/autojump.zsh
fi

補完が聞かない等の不具合が出る場合は以下の命令を上記スクリプトの下に追記する。

autoload -U compinit && compinit
11
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
12