1
0
Fork 0
dotfiles/.zshrc

67 lines
2.0 KiB
Bash
Raw Normal View History

# ~/.zshrc: executed by zsh(1) for non-login shells
2022-09-23 19:28:12 +05:30
# if not running interactively, don't do anything
2022-09-23 19:28:12 +05:30
case $- in
*i*) ;;
*) return;;
esac
2022-12-21 08:48:40 +05:30
HISTORY_CONF=$ZSH_CONFS_DIRECTORY/10_history
ALIASES_CONF=$ZSH_CONFS_DIRECTORY/20_aliases
SYNTAX_HIGHLIGHT_CONF=$ZSH_CONFS_DIRECTORY/90_syntax_highlight
# for using comments in interactive shell
setopt INTERACTIVECOMMENTS
# directory where most of my zsh files are stored
ZSH_CONFS_DIRECTORY="$HOME/.config/zsh_confs"
2022-09-23 19:28:12 +05:30
# load options related to history
2022-12-21 08:48:40 +05:30
[ -f $HISTORY_CONF ] && source $HISTORY_CONF
# keep the space after tab completion
ZLE_REMOVE_SUFFIX_CHARS=""
# key-bindings
2022-09-23 19:28:12 +05:30
if [[ -f "$HOME/.zkbd/$TERM" ]]; then
source $HOME/.zkbd/$TERM
2022-09-23 19:28:12 +05:30
[[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
[[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
fi
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
bindkey '^i' expand-or-complete-prefix
# prompt
2022-09-23 19:28:12 +05:30
PROMPT=$'\n%F{11}─┬─[%f %F{5}%y %f%F{white}%? %D %*%f %F{11}]%f
%F{11} ├─[%f %F{red}%m:%f %F{white}%n%f %F{8}▶%f %F{cyan}%/%f %F{11}]%f
%F{11} ╰─>%F{11}%f '
# common stuff...
MACHINE_HOSTNAME=$(cat /etc/hostname)
if [[ "$MACHINE_HOSTNAME" == "flameboi" ]]; then
# The following lines were added by compinstall
zstyle ':completion:*' completer _alternative _approximate _arguments _complete _expand _ignored
zstyle ':completion:*' group-name ''
zstyle compinstall filename "$HOME/.zshrc"
autuload -Uz compinit
compinit
# End of lines added by compinstall
else if [[ "$MACHINE_HOSTNAME" == "bluefeds" || "$MACHINE_HOSTNAME" == "sentinel" ]]; then
# use bigger fonts on the console
case $(tty) in
(/dev/tty[0-9]) setfont /usr/share/consolefonts/Lat2-Terminus28x14.psf.gz;;
(/dev/pts[0-9]) ;;
esac
fi
2022-09-23 19:28:12 +05:30
# source aliases
2022-12-21 08:48:40 +05:30
[ -f $ALIASES_CONF ] && source $ALIASES_CONF
2022-09-23 19:28:12 +05:30
# source zsh syntax highlighting
2022-12-21 08:48:40 +05:30
[ -f $SYNTAX_HIGHLIGHT_CONF ] && source $SYNTAX_HIGHLIGHT_CONF