-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc
85 lines (68 loc) · 3.1 KB
/
dot_zshrc
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
HISTFILE=~/.histfile
HISTSIZE=2000
SAVEHIST=1000
bindkey -e
# The following lines were added by compinstall
zstyle :compinstall filename "$HOME/.zshrc"
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Set editor to nvim
export EDITOR="nvim"
# aliases
[[ -f "$HOME/.aliases" ]] && source "$HOME/.aliases"
# Fix: keybinds
bindkey "^[[H" beginning-of-line # Home
bindkey "^[[F" end-of-line # End
bindkey "^[[3~" delete-char # Delete
bindkey "^[[1;5C" forward-word # CTRL+Right
bindkey "^[[1;5D" backward-word # CTRL+Left
bindkey "^H" backward-kill-word # CTRL+Backspace
bindkey "^[[3;5~" kill-word # CTRL+Delete
# tab completion on menus
zstyle ':completion:*' menu select
# p10k - fancy prompts!
source "$HOME/powerlevel10k/powerlevel10k.zsh-theme"
[[ ! -f "$HOME/.p10k.zsh" ]] || source "$HOME/.p10k.zsh"
# ZSH plugins and functions
# format: 'github-user/repo-name'
# usage: `source plugins.zsh` file; this will install it
local plugins=(
zsh-users/zsh-autosuggestions
zsh-users/zsh-syntax-highlighting
)
[[ -f "$HOME/.config/zsh/check_bin.zsh" ]] && source "$HOME/.config/zsh/check_bin.zsh" # provides check_bin <bin>
[[ -f "$HOME/.config/zsh/add_path.zsh" ]] && source "$HOME/.config/zsh/add_path.zsh" # provides add_path <dir>
[[ -f "$HOME/.config/zsh/plugins.zsh" ]] && source "$HOME/.config/zsh/plugins.zsh" # sourcing installs plugins
[[ -f "$HOME/.config/zsh/ssh.zsh" ]] && source "$HOME/.config/zsh/ssh.zsh" # sourcing sets up ssh-agent
[[ -f "$HOME/.config/zsh/dev.zsh" ]] && source "$HOME/.config/zsh/dev.zsh" # provides `dev`
# Include own binaries and scripts
add_path "$HOME/bin"
add_path "$HOME/bin/scripts"
# Haskell binaries
add_path "$HOME/.ghcup/bin"
# SDKMAN for JVM related languages
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
# Rust binaries
add_path "$HOME/.cargo/bin"
# Julia binaries
add_path "$HOME/.juliaup/bin"
# Ruby binaries and gems
export GEM_HOME="$HOME/.gems" # set home variable for ruby gems
# Node, bun, and other JS/TS binaries
add_path "$HOME/.bun/bin"
[[ -f "$HOME/.bun/_bun" ]] && source "$HOME/.bun/_bun" # bun has completions, sourced below
[[ -f "$HOME/.config/nvm/nvm.sh" ]] && source "$HOME/.config/nvm/nvm.sh" # nvm is a shell script, sourced below
[[ -f "$HOME/.config/nvm/bash_completion" ]] && source "$HOME/.config/nvm/bash_completion" # nvm has completions, sourced below
add_path "$HOME/.sass"
# Go binaries
add_path "$HOME/go/bin"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh