-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
93 lines (69 loc) · 1.9 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Path to oh-my-zsh installation
export ZSH=$HOME/.oh-my-zsh
# Theme to load.
ZSH_THEME="ys"
# Custom folder path
ZSH_CUSTOM=$HOME/.zsh-custom
# Set data file
export _Z_DATA=$HOME/.z
# Set pyenv directory
export PYENV_ROOT=$HOME/.pyenv
# Set nvm directory
export NVM_DIR="$HOME/.nvm"
# Check file exists or create it
[ -f $_Z_DATA ] || touch $_Z_DATA
# Plugins to load
plugins=(git node npm nvm gnu-utils z)
# User configuration
source $ZSH/oh-my-zsh.sh
# Add zsh highlighting
source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Set Editor
export EDITOR='nvim'
# 10ms for key sequences
KEYTIMEOUT=1
# Set maximum number of open file descriptors
ulimit -n 2048
# Expand aliases
setopt aliases
# History settings
HISTSIZE=10000000
SAVEHIST=10000000
setopt hist_ignore_all_dups
setopt share_history
setopt hist_ignore_space
# Vim bindings
bindkey -v
bindkey -v '^?' backward-delete-char
bindkey -M vicmd v edit-command-line
# Change the cursor shape for normal and insert mode
function zle-line-init zle-keymap-select {
case $KEYMAP in
vicmd) print -n -- "\e[2 q";; # block cursor
viins|main) print -n -- "\e[6 q";; # line cursor
esac
zle reset-prompt
zle -R
}
function zle-line-finish {
print -n -- "\e[2 q" # block cursor
}
zle -N zle-line-init
zle -N zle-line-finish
zle -N zle-keymap-select
# Add paths
export PATH=$(getconf PATH);
export PATH="/sbin:$PATH";
export PATH=/opt/homebrew/bin:$PATH
export PATH="/usr/local/bin:$PATH";
export PATH="/usr/local/sbin:$PATH";
export PATH="$PYENV_ROOT/bin:$PATH";
export RIPGREP_CONFIG_PATH="$HOME/.ripgreprc";
# Init pyenv
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# Configure nvm
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Load fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh