-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
75 lines (65 loc) · 2.34 KB
/
.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
setopt NO_CASE_GLOB
setopt SHARE_HISTORY
setopt EXTENDED_HISTORY
setopt APPEND_HISTORY
setopt HIST_VERIFY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_FIND_NO_DUPS
setopt HIST_REDUCE_BLANKS
setopt HIST_IGNORE_SPACE
setopt PROMPT_SUBST
setopt AUTO_CD
setopt AUTO_PUSHD
# ====== Prompt ======
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
zstyle ':vcs_info:git:*' formats ' %F{242}git:(%b)%f%F{green}%c%f%F{yellow}%u%f'
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr '*'
zstyle ':vcs_info:*' stagedstr '+'
PROMPT='%B%F{%(?.blue.red)}%1~%f%b$vcs_info_msg_0_ '
# ====== Completion ======
# Colors for directories, ls, cd, etc.
zstyle ':completion:*' list-colors 'di=34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30' && export CLICOLOR=1
# Case-insensitive completion
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
# Partial completion suggestions
zstyle ':completion:*' list-suffixes
zstyle ':completion:*' expand prefix suffix
# Completion menu
zstyle ':completion:*' menu select
bindkey '^[[Z' reverse-menu-complete
autoload -U select-word-style
select-word-style bash
# Support bash completions
autoload bashcompinit && bashcompinit
autoload -Uz compinit && compinit
PATH="$PATH:/opt/homebrew/bin"
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='nvim'
fi
# For Csharpier to work with conform and dotnet installed via brew
# might work out of the box if dotnet installed from web
if [[ -d "/opt/homebrew/opt/dotnet" ]]
then
export DOTNET_ROOT="/opt/homebrew/opt/dotnet/libexec"
fi
# ===== VIPPS =====
[ -f "$HOME/vipps/checkout-frontend-envs.sh" ] && source "$HOME/vipps/checkout-frontend-envs.sh"
# Tools config
[ -x "$(command -v zoxide)" ] && eval "$(zoxide init zsh)"
# [ -x "$(command -v ngrok)" ] && eval "$(ngrok completion)"
[ -x "$(command -v fzf)" ] && source <(fzf --zsh)
# TODO: set up site functions
# e.g. /opt/homebrew/share/zsh/site-functions
if [[ -d "$HOME/.zsh" ]]
then
source "$HOME/.zsh/alias.zsh"
source "$HOME/.zsh/git.zsh"
source "$HOME/.zsh/function.zsh"
fi