-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecutable_dot_zshrc
More file actions
96 lines (78 loc) · 2.78 KB
/
executable_dot_zshrc
File metadata and controls
96 lines (78 loc) · 2.78 KB
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
86
87
88
89
90
91
92
93
94
95
# install zinit
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)"
[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
source "${ZINIT_HOME}/zinit.zsh"
# Load starship theme
# line 1: `starship` binary as command, from github release
# line 2: starship setup at clone(create init.zsh, completion)
# line 3: pull behavior same as clone, source init.zsh
zinit ice as"command" from"gh-r" \
atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \
atpull"%atclone" src"init.zsh"
zinit light starship/starship
# Add in zsh plugins
zinit light zsh-users/zsh-syntax-highlighting
zinit light zsh-users/zsh-completions
zinit light zsh-users/zsh-autosuggestions
zinit light Aloxaf/fzf-tab
# some snippets from omz plugins require completion directory to exist
# a fix for this was submitted in zinit repo, remove this in future
mkdir -p "$ZSH_CACHE_DIR/completions"
# Add in snippets
zinit snippet OMZP::mise
zinit snippet OMZL::git.zsh
zinit snippet OMZP::git
zinit snippet OMZP::vi-mode
# Load completions
autoload -Uz compinit && compinit
zinit cdreplay -q
# History
HISTSIZE=5000
HISTFILE=~/.zsh_history
SAVEHIST=$HISTSIZE
HISTDUP=erase
setopt appendhistory
setopt sharehistory
setopt hist_ignore_space
setopt hist_ignore_all_dups
setopt hist_save_no_dups
setopt hist_ignore_dups
setopt hist_find_no_dups
# case insensitive command completion
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
# add colors to command completion
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
# disable zsh-completion menu and instead rely on fzf-tab menu
zstyle ':completion:*' menu no
# add colors to fzf tab menu for cd completion
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
# add colors to fzf tab menu for zoxide completion
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
# setup fzf keybindings
eval "$(fzf --zsh)"
# setup zoxide to use during cd
eval "$(zoxide init --cmd cd zsh)"
alias ls="ls --color"
alias ll="ls -la --color"
alias c="clear"
alias cz="chezmoi"
alias cheat="cheat -c"
# setup language as UTF-8
LANG=en_EN.UTF8
# setup default editor
export EDITOR="$(which vim)"
# setup for golang
# export GOPATH=$HOME/go
# add intellij idea to path
export PATH="/Applications/IntelliJ IDEA.app/Contents/MacOS:$PATH"
# for vim-mode in terminal using ohmyzsh plugins
MODE_INDICATOR="NORMAL->"
PROMPT="$PROMPT\$(vi_mode_prompt_info)"
# setup path
export PATH="$HOME/App/bin:$HOME/.emacs.d/bin:$GOPATH/bin:/opt/podman/bin:$PATH"
### MANAGED BY RANCHER DESKTOP START (DO NOT EDIT)
export PATH="$HOME/.rd/bin:$PATH"
### MANAGED BY RANCHER DESKTOP END (DO NOT EDIT)
# setup mise en place
eval "$(mise activate zsh)"