64 lines
1.5 KiB
Bash
64 lines
1.5 KiB
Bash
#!/bin/bash
|
|
#
|
|
# SCRIPT NAME:
|
|
# .zshrc
|
|
#
|
|
# AUTHOR:
|
|
# Severin Kaderli <severin@kaderli.dev>
|
|
#
|
|
# DESCRIPTION:
|
|
# This script is called when you start a new shell.
|
|
#
|
|
# USAGE:
|
|
# This script is automatically executed when you start a new shell.
|
|
|
|
# Zsh options
|
|
setopt prompt_subst
|
|
setopt extendedglob
|
|
unsetopt correct
|
|
|
|
# Zsh keybindings
|
|
bindkey "\e[H" beginning-of-line
|
|
bindkey "\e[F" end-of-line
|
|
bindkey "\e[5~" beginning-of-history
|
|
bindkey "\e[6~" end-of-history
|
|
bindkey "\e[3~" delete-char
|
|
bindkey "\e[2~" quoted-insert
|
|
bindkey "\e[5C" forward-word
|
|
bindkey "\eOc" emacs-forward-word
|
|
bindkey "\e[5D" backward-word
|
|
bindkey "\eOd" emacs-backward-word
|
|
bindkey "\ee[C" forward-word
|
|
bindkey "\ee[D" backward-word
|
|
bindkey "^H" backward-delete-word
|
|
|
|
# Enable autocompletion features
|
|
autoload -Uz compinit
|
|
compinit
|
|
zstyle ':completion:*' menu select
|
|
|
|
# Persistent rehash
|
|
zstyle ':completion:*' rehash true
|
|
|
|
# XDG_Base_Directories
|
|
export XDG_CONFIG_HOME="${HOME}/.config"
|
|
export XDG_CACHE_HOME="${HOME}/.cache"
|
|
export XDG_DATA_HOME="${HOME}/.local/share"
|
|
export XDG_BIN_HOME="${HOME}/.local/bin"
|
|
export XDG_LOG_HOME="${HOME}/.local/log"
|
|
|
|
# Sourcing environment variables
|
|
if [ -f "${XDG_CONFIG_HOME}/custom/env" ]; then
|
|
. "${XDG_CONFIG_HOME}/custom/env"
|
|
fi
|
|
|
|
# Enable color support of ls
|
|
if [ -f "${XDG_CONFIG_HOME}/custom/dircolors" ]; then
|
|
dircolors -b "${XDG_CONFIG_HOME}/custom/dircolors" > /dev/null 2>&1
|
|
fi
|
|
|
|
# Sourcing alias definitions
|
|
if [ -f "${XDG_CONFIG_HOME}/custom/aliases" ]; then
|
|
. "${XDG_CONFIG_HOME}/custom/aliases"
|
|
fi
|
|
|