Last active
November 15, 2020 02:38
-
-
Save hbsnow/3c8991898f8830b58c67dfa33426cac4 to your computer and use it in GitHub Desktop.
zsh設定ファイル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export LANG=ja_JP.UTF-8 | |
export LC_ALL=ja_JP.UTF-8 | |
export VISUAL='code -w' | |
export EDITOR=$VISUAL | |
autoload -Uz is-at-least | |
# prezto | |
if [ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]; then | |
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" | |
fi | |
# anyenv | |
if [ -d $HOME/.anyenv ]; then | |
export PATH="$HOME/.anyenv/bin:$PATH" | |
fi | |
# cdr | |
if is-at-least 4.3.11; then | |
autoload -Uz chpwd_recent_dirs cdr add-zsh-hook | |
add-zsh-hook chpwd chpwd_recent_dirs | |
chpwd_functions+=chpwd_recent_dirs | |
zstyle ':chpwd:*' recent-dirs-max 1000 | |
zstyle ':chpwd:*' recent-dirs-default true | |
zstyle ':completion:*' recent-dirs-insert always | |
# 既に存在しないディレクトリをcdrのリストから削除する | |
# https://blog.n-z.jp/blog/2014-07-25-compact-chpwd-recent-dirs.html | |
function _my-compact-chpwd-recent-dirs() { | |
emulate -L zsh | |
setopt extendedglob | |
local -aU reply | |
integer history_size | |
autoload -Uz chpwd_recent_filehandler | |
chpwd_recent_filehandler | |
history_size=$#reply | |
reply=(${^reply}(N)) | |
(( $history_size == $#reply )) || chpwd_recent_filehandler $reply | |
} | |
_my-compact-chpwd-recent-dirs | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
インストール手順: https://medium.com/@oldwestaction/beautifying-your-terminal-with-zsh-prezto-powerlevel9k-9e8de2023046