🗝
summary refs log tree commit diff
path: root/zshrc
blob: e07c36d1976e0b63b0ddf26eac64fe8d4ec932d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 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)