🗝
summary refs log tree commit diff
path: root/zshrc
diff options
context:
space:
mode:
authormia <mia@mia.jetzt>2024-03-10 13:28:56 -0700
committermia <mia@mia.jetzt>2024-03-10 13:28:56 -0700
commitefe49395d4194db30f55a91503c91cda33530e8e (patch)
treec2f73587f40d4cd9d66c906fbfcfda97620074cc /zshrc
parent762534242de9e84a4bceb45a1ca2e58d2a15b50d (diff)
downloaddotfiles-efe49395d4194db30f55a91503c91cda33530e8e.tar.gz
dotfiles-efe49395d4194db30f55a91503c91cda33530e8e.zip
add zsh configuration
Diffstat (limited to 'zshrc')
-rw-r--r--zshrc39
1 files changed, 39 insertions, 0 deletions
diff --git a/zshrc b/zshrc
new file mode 100644
index 0000000..fa6d882
--- /dev/null
+++ b/zshrc
@@ -0,0 +1,39 @@
+# If not running interactively, don't do anything
+[[ $- != *i* ]] && return
+
+zstyle :compinstall filename '/home/.zshrc'
+zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+autoload -Uz compinit
+compinit
+
+keymap_file="$HOME/.config/zsh/keymap/$TERM"
+[[ ! -d "$(dirname "$keymap_file")" ]] && mkdir -p "$(dirname "$keymap_file")"
+[[ ! -f "$keymap_file" ]] && ~/.config/zsh/init-keymap.zsh "$keymap_file"
+source "$keymap_file"
+unset keymap_file
+
+[[ -n "${key[Home]}"          ]] && bindkey -- "${key[Home]}"          beginning-of-line
+[[ -n "${key[End]}"           ]] && bindkey -- "${key[End]}"           end-of-line
+[[ -n "${key[Insert]}"        ]] && bindkey -- "${key[Insert]}"        overwrite-mode
+[[ -n "${key[Backspace]}"     ]] && bindkey -- "${key[Backspace]}"     backward-delete-char
+[[ -n "${key[CtrlBackspace]}" ]] && bindkey -- "${key[CtrlBackspace]}" backward-delete-word
+[[ -n "${key[Delete]}"        ]] && bindkey -- "${key[Delete]}"        delete-char
+[[ -n "${key[Up]}"            ]] && bindkey -- "${key[Up]}"            up-line-or-history
+[[ -n "${key[Down]}"          ]] && bindkey -- "${key[Down]}"          down-line-or-history
+[[ -n "${key[Left]}"          ]] && bindkey -- "${key[Left]}"          backward-char
+[[ -n "${key[Right]}"         ]] && bindkey -- "${key[Right]}"         forward-char
+[[ -n "${key[CtrlLeft]}"      ]] && bindkey -- "${key[CtrlLeft]}"      backward-word
+[[ -n "${key[CtrlRight]}"     ]] && bindkey -- "${key[CtrlRight]}"     forward-word
+
+export EDITOR=nano
+export PAGER=less
+alias zm=zmachine
+alias zmachine="$EDITOR ~/.config/zsh/machine.zsh"
+alias zshrc="$EDITOR ~/.zshrc"
+
+[[ -f ~/.config/zsh/machine.zsh ]] && source ~/.config/zsh/machine.zsh
+
+source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
+source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+source <(starship init zsh)
+source <(zoxide init zsh)