-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop using nix for zsh configuration
- Loading branch information
1 parent
bfe2a80
commit 7d0776a
Showing
11 changed files
with
111 additions
and
204 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
source $HOME/.config/zsh/legacy/exports.zsh | ||
source $HOME/.config/zsh/legacy/aliases.zsh | ||
|
||
bindkey -e # emacs emulation | ||
autoload -Uz add-zsh-hook | ||
|
||
ulimit -u 2048 | ||
ulimit -n 16384 | ||
|
||
# Zsh options | ||
# ================================================================ | ||
REPORTTIME=3 | ||
|
||
setopt correct | ||
setopt interactive_comments | ||
setopt extended_glob | ||
|
||
# ---- Histroy ---- | ||
HISTFILE="${ZDOTDIR}/.zsh_history" | ||
HISTSIZE=10000 # メモリに保存される履歴の件数 | ||
SAVEHIST=1000000 # 保存される履歴の件数 | ||
# https://github.com/rothgar/mastering-zsh/blob/921766e642bcf02d0f1be8fc57d0159a867299b0/docs/config/history.md | ||
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format. | ||
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits. | ||
setopt SHARE_HISTORY # Share history between all sessions. | ||
setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history. | ||
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again. | ||
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate. | ||
setopt HIST_FIND_NO_DUPS # Do not display a previously found event. | ||
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space. | ||
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file. | ||
setopt HIST_VERIFY # Do not execute immediately upon history expansion. | ||
setopt APPEND_HISTORY # append to history file | ||
setopt HIST_NO_STORE # Don't store history commands | ||
|
||
autoload -Uz chpwd_recent_dirs cdr add-zsh-hook | ||
add-zsh-hook chpwd chpwd_recent_dirs | ||
zstyle ':chpwd:*' recent-dirs-max 5000 | ||
zstyle ':chpwd:*' recent-dirs-default yes | ||
zstyle ':chpwd:*' recent-dirs-prune 'parent' | ||
zstyle ':completion:*' recent-dirs-insert both | ||
|
||
# cdしたあとで、自動的に ls する | ||
function chpwd() { ls } | ||
|
||
# ---- Directory stack ---- | ||
setopt auto_cd # ディレクトリ名を入力したら自動でcd | ||
setopt auto_pushd # ディレクトリスタックに追加(`cd +<Tab>`で履歴表示) | ||
setopt pushd_ignore_dups # pushd時にすでにスタックに含まれてた場合は追加しない | ||
DIRSTACKSIZE=100 # ディレクトリスタック保存件数 | ||
|
||
# ---- Completion ---- | ||
if [ -d "$HOME/.nix-profile/share/zsh/site-functions" ]; then | ||
fpath=($HOME/.nix-profile/share/zsh/site-functions $fpath) | ||
fi | ||
|
||
setopt auto_menu # 補完候補が複数あるときに自動的に一覧表示 | ||
bindkey "^[[Z" reverse-menu-complete # Shift-Tabで補完候補を逆順する("\e[Z"でも動作する) | ||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # 補完時に大文字小文字を区別しない | ||
|
||
autoload -Uz compinit; compinit -C | ||
|
||
# Load plugins | ||
# ================================================================ | ||
source $HOME/.config/zsh/legacy/functions.zsh | ||
source $HOME/.config/zsh/legacy/fzf.zsh | ||
|
||
# direnv | ||
if type direnv > /dev/null 2>&1; then | ||
eval "$(direnv hook zsh)" | ||
fi | ||
|
||
# fnm (Node.js) | ||
if type fnm >/dev/null 2>&1; then | ||
eval "$(fnm env --use-on-cd --log-level error)" | ||
fi | ||
|
||
# 1Password | ||
if [ -d "${HOME}/.config/op/plugins.sh" ]; then | ||
source "${HOME}/.config/op/plugins.sh" | ||
fi | ||
|
||
# Orbstack | ||
if [ -f "${HOME}/.orbstack/shell/init.zsh" ]; then | ||
source "${HOME}/.orbstack/shell/init.zsh" | ||
fi | ||
|
||
# Starship | ||
eval "$(starship init zsh)" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
setopt no_global_rcs # disable path helper | ||
|
||
export ZDOTDIR="${HOME}/.config/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