dotfiles/home/r0r5chach/.zshrc

50 lines
1.3 KiB
Bash
Raw Normal View History

2023-07-07 14:49:59 +00:00
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/r0r5chach/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Aliases
alias ls='ls --color=auto'
alias grep='grep --color=auto'
2023-07-11 04:43:17 +00:00
alias diff='colordiff'
alias lzd='lazydocker'
alias lg='lazygit'
alias ping='gping'
2023-07-07 14:49:59 +00:00
# Prompt Config
SUCCESS="%F{blue}ʘ‿ʘ%f" # What to display upon Command success
2023-07-11 04:43:17 +00:00
FAIL="%F{red}⊙╭╮⊙%f" # What to display upon Command failure
2023-07-07 14:49:59 +00:00
preexec() {
preexec_called=1
}
precmd() { # Generates command success output for next prompt
if [ "$?" != 0 ] && [ "$preexec_called" = 1 ]; then
COMMAND_SUCCESS=$FAIL; unset preexec_called;
else
COMMAND_SUCCESS=$SUCCESS; unset preexec_called;
fi
}
setopt PROMPT_SUBST # Allows prompt to call functions
PROMPT='$(echo $COMMAND_SUCCESS)[%n@%m %~]$ '
# Keybinds
bindkey "^[[H" beginning-of-line # Home moves cursor to start of line
bindkey "^[[F" end-of-line # End moves cursor to end of line
bindkey "^[[3~" delete-char # Delete deletes a character
bindkey "^[[1;5C" forward-word # Ctrl+Right moves foward a word
bindkey "^[[1;5D" backward-word # Ctrl+Left moves backward a word
2023-07-07 17:59:23 +00:00
/home/r0r5chach/.config/zsh/init