diff options
-rw-r--r-- | .config/zsh/.zshenv | 1 | ||||
-rw-r--r-- | .config/zsh/.zshrc | 54 | ||||
-rw-r--r-- | README.md | 8 |
3 files changed, 57 insertions, 6 deletions
diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv index 77603e5..d002695 100644 --- a/.config/zsh/.zshenv +++ b/.config/zsh/.zshenv @@ -1,4 +1,5 @@ export EDITOR='vim' +export PAGER='less' if [[ $INTELLIJ -eq 1 ]]; then export PATH=/usr/local/bin:/usr/bin:$PATH diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index b5b37ce..4aed2b7 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -2,6 +2,39 @@ setopt autocd export CDPATH=".:$HOME:$HOME/devil:$HOME/src" +# use multiple redirections to imply tee / cat +setopt multios + +# spelling correction... TBA if we like this +# could also use correct_all & potentially alias some things with nocorrect +setopt correct + +# completions +setopt complete_in_word # complete both ends of words +setopt always_to_end # and move cursor to the end afterward +setopt auto_menu # <tab><tab> brings up the menu ... +unsetopt menu_complete # ... and does not select the first option +setopt auto_param_slash # convenience: add trailing / after directories +setopt extended_glob +unsetopt flow_control +zstyle ':completion:*' special-dirs true +# cache completions +zstyle ':completion::complete:*' use-cache yes +zstyle ':completion::complete:*' cache-path "$HOME/.zcompcache" +# enable completions +autoload -Uz compinit && compinit + +# history +HISTFILE="$HOME/.zsh_history" +HISTSIZE=10000 +SAVEHIST=$HISTSIZE +setopt bang_hist +setopt extended_history # write timestamp +setopt inc_append_history # write always, not just at end of session +setopt hist_ignore_space # add leading space to hide from history +setopt hist_ignore_dups # deduplicate commands run twice in a row +setopt hist_verify # confirm before executing + # vi mode bindkey -v # make backspace and delete behave like vim @@ -21,11 +54,27 @@ zle -N zle-keymap-select zle -N zle-line-init zle -N zle-line-finish +# colors in various core utils +alias diff='diff --color' +alias ls='ls --color=auto' +export LESS='-R' + +grep_opts="--color=auto --exclude-dir=.git" +alias grep="grep $grep_opts" +alias egrep="egrep $grep_opts" +alias fgrep="fgrep $grep_opts" +unset grep_opts + +# dots go up +alias -g ...='../..' +alias -g ....='../../..' +alias -g .....='../../../..' + # aliases alias cls=clear alias config='git --git-dir=$HOME/.dotfiles --work-tree=$HOME' -alias ls='ls --color=auto' alias ll='ls -l --almost-all --no-group --human-readable' +alias mkdir='mkdir -p' # collapse spaces into tabs in-place # spacetotab <FILE> [WIDTH=4] @@ -34,5 +83,8 @@ function spacetotab () { mv "$1.tmp" "$1" } +# prompt +setopt prompt_subst + # display a fortune when opening an interactive terminal tty -s && fortune $HOME/fortunes 2>/dev/null ||: diff --git a/README.md b/README.md index ee03343..cf28c0a 100644 --- a/README.md +++ b/README.md @@ -37,14 +37,12 @@ END >> /etc/ssh/sshd_config ### todo * zsh plugins - * probably antigen for the plugin manager - * antigen use oh-my-zsh && antigen bundle git - * p10k - * zsh-users/zsh-history-substring-search (probably not when zsh already has ctrl+r) + * not sure if antigen, zinit, or zgen for the plugin manager + * junegunn/fzf + * p10k? * zsh-users/zsh-autosuggestions (maybe) * zsh-users/zsh-syntax-highlighting * zsh-users/zsh-completions - * knu/zsh-manydots-magic * fortune * firefox lockwise * autoupdates |