66 lines
2.3 KiB
Bash
66 lines
2.3 KiB
Bash
# Auto completion.
|
||
autoload -Uz compinit
|
||
zstyle ':completion:*' menu select
|
||
zstyle ':completion:*' completer _expand _complete _ignored
|
||
zstyle :compinstall filename '$HOME/.zshrc'
|
||
zmodload zsh/complist
|
||
compinit
|
||
_comp_options+=(globdots)
|
||
|
||
# Lines configured by zsh-newuser-install
|
||
HISTFILE=~/.histfile
|
||
HISTSIZE=1000
|
||
SAVEHIST=1000
|
||
setopt autocd nomatch
|
||
unsetopt beep extendedglob notify
|
||
# End of lines configured by zsh-newuser-install
|
||
|
||
# Prompt left and right.
|
||
PROMPT='%n@%m[%T]: %B%F{240}%1~%f%b %# '
|
||
RPROMPT='%(?.%F{green}√.%F{red}?%?)%f'
|
||
|
||
bindkey -e # Emacs mode.
|
||
# Key bindings.
|
||
test -n "$terminfo[kdch1]" && bindkey "$terminfo[kdch1]" delete-char
|
||
test -n "$terminfo[kpp]" && bindkey "$terminfo[kpp]" beginning-of-buffer-or-history
|
||
test -n "$terminfo[knp]" && bindkey "$terminfo[knp]" end-of-buffer-or-history
|
||
|
||
test -n "$terminfo[khome]" && bindkey -M emacs "$terminfo[khome]" beginning-of-line
|
||
test -n "$terminfo[kend]" && bindkey -M emacs "$terminfo[kend]" end-of-line
|
||
|
||
[[ "$terminfo[khome]" == "O"* ]] && bindkey -M emacs "${terminfo[khome]/O/[}" beginning-of-line
|
||
[[ "$terminfo[kend]" == "O"* ]] && bindkey -M emacs "${terminfo[kend]/O/[}" end-of-line
|
||
|
||
test -n "$terminfo[kcbt]" && bindkey -M menuselect "$terminfo[kcbt]" reverse-menu-complete
|
||
|
||
# Load additional key bindings.
|
||
eval "$(fzf --zsh 2> /dev/null)"
|
||
|
||
# Aliases.
|
||
alias ls='ls --color' la='ls -a' ll='ls -l' lla='ll -a'
|
||
alias mc='mc -xc'
|
||
alias grep='grep --color=auto'
|
||
|
||
cp() if [ -t 0 ]; then command cp -i "$@"; else command cp "$@"; fi
|
||
mv() if [ -t 0 ]; then command mv -i "$@"; else command mv "$@"; fi
|
||
rm() if [ -t 0 ]; then command rm -i "$@"; else command rm "$@"; fi
|
||
|
||
# Keep working directory in a new instance for vte terminal emulators
|
||
test -f /etc/profile.d/vte.sh && source /etc/profile.d/vte.sh
|
||
|
||
# Completion for kitty
|
||
kitty + complete setup zsh | source /dev/stdin
|
||
|
||
. ~/.zshenv # Restore $PATH to my custom one
|
||
|
||
# Plugins
|
||
if [ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]
|
||
then
|
||
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||
elif [ -n "$HOMEBREW_PREFIX" -a -f $HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]
|
||
then
|
||
source $HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||
fi
|
||
|
||
whence -p fastfetch > /dev/null && fastfetch
|