Set up OS-specific zsh configs
- Move keybinds into a match for Darwin systems - Move BSD-isms into the same match, split off Linux-isms for binutils into a match for linux systems - Add a comment or two for some directives I did not immediately remember what they did, so I'll remember next time more easily
This commit is contained in:
parent
098d12d332
commit
8d0674865d
1 changed files with 20 additions and 11 deletions
31
.zshrc
31
.zshrc
|
@ -1,5 +1,6 @@
|
||||||
export LANG=en_US.UTF-8
|
export LANG=en_US.UTF-8
|
||||||
|
|
||||||
|
# Start keychain only on my personal system
|
||||||
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
||||||
SESSION_TYPE=ssh
|
SESSION_TYPE=ssh
|
||||||
else
|
else
|
||||||
|
@ -15,11 +16,6 @@ fi
|
||||||
|
|
||||||
source ~/.p10k/powerlevel10k.zsh-theme
|
source ~/.p10k/powerlevel10k.zsh-theme
|
||||||
|
|
||||||
# Make extra keys in MacOSX behave like expected
|
|
||||||
bindkey "^[[H" beginning-of-line # HOME
|
|
||||||
bindkey "^[[F" end-of-line # END
|
|
||||||
bindkey "^[[3~" delete-char # DEL
|
|
||||||
|
|
||||||
# Print user@host into title so terminal tabs are correct
|
# Print user@host into title so terminal tabs are correct
|
||||||
# Despite being called precmd() this executes after process exits, before prompt
|
# Despite being called precmd() this executes after process exits, before prompt
|
||||||
precmd() { echo -ne "\033]0;${USER}@${HOST}\007" }
|
precmd() { echo -ne "\033]0;${USER}@${HOST}\007" }
|
||||||
|
@ -34,17 +30,30 @@ if [[ -a /usr/bin/most ]]; then
|
||||||
export PAGER=most
|
export PAGER=most
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# OS-specific directives
|
||||||
|
case "$OSTYPE" in
|
||||||
|
darwin*)
|
||||||
|
bindkey "^[[H" beginning-of-line # HOME
|
||||||
|
bindkey "^[[F" end-of-line # END
|
||||||
|
bindkey "^[[3~" delete-char # DEL
|
||||||
|
alias ls='ls -G'
|
||||||
|
;;
|
||||||
|
linux*)
|
||||||
|
alias ls='ls --color=auto'
|
||||||
|
alias diff='diff --color=auto'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Global aliases
|
||||||
|
alias ct="clear && task"
|
||||||
|
alias tt="taskwarrior-tui"
|
||||||
|
alias grep='grep -EIs --color=auto --exclude-dir=.git'
|
||||||
|
|
||||||
HISTFILE=~/.zsh_history
|
HISTFILE=~/.zsh_history
|
||||||
HISTSIZE=10000
|
HISTSIZE=10000
|
||||||
SAVEHIST=10000
|
SAVEHIST=10000
|
||||||
setopt appendhistory
|
setopt appendhistory
|
||||||
|
|
||||||
alias ct="clear && task"
|
|
||||||
alias tt="taskwarrior-tui"
|
|
||||||
alias ls='ls --color=auto'
|
|
||||||
alias grep='grep -EIs --color=auto --exclude-dir=.git'
|
|
||||||
alias diff='diff --color=auto'
|
|
||||||
|
|
||||||
# Case-insensetive tab completion
|
# Case-insensetive tab completion
|
||||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue