LoginSignup
18
20

More than 5 years have passed since last update.

zshでの移動をとにかく楽にする

Last updated at Posted at 2012-12-26

今回は、簡単にできてかつ、効果的なzshのカスタマイズを紹介していきたいと思います。テーマは移動です。

zshrc

~/.zshrc
# 'cd' なしで移動する
setopt auto_cd
setopt auto_pushd

# 重複するディレクトリは記録しないようにする
setopt correct

# 'cd -' [Tab] で以前移動したディレクトリに移動する
setopt pushd_ignore_dups

# 移動した後は 'ls' する
function chpwd() { ls -F }

# '^' を押すと上のディレクトリに移動する
function cdup() {
echo
cd ..
zle reset-prompt
}
zle -N cdup
bindkey '\^' cdup

autojump

autojumpをインストールすると、j <キーワード>でキーワードに関連する移動頻度が高いディレクトリ一覧を表示してくれます。また、j D__3などの番号でも移動できます。

# https://github.com/joelthelion/autojump

brew install autojump

j --stat
18
20
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
18
20