-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
145 lines (120 loc) · 4.37 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <[email protected]>
#
# Source Prezto.
#if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
# source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
#fi
# Antigen plugins
source ~/antigen.zsh
# Bundles from the default repo (robbyrussell's oh-my-zsh).
antigen bundle git
# Syntax highlighting bundle.
# antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-history-substring-search
# aws completion
autoload bashcompinit && bashcompinit
autoload -Uz compinit && compinit
complete -C '/usr/local/bin/aws_completer' aws
# git fzf plugin
antigen bundle 'wfxr/forgit'
#
# Tell Antigen that you're done.
antigen apply
# Bind up/down for history search
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1
# Customize to your needs...
export PATH=$PATH:$HOME/bin
# export LC_ALL=en_US.UTF-8
# Load history (and set to unlimited length)
HISTFILE=~/.zsh_history
HISTSIZE=10000
HISTFILESIZE=10000
SAVEHIST=10000
setopt APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_IGNORE_ALL_DUPS
#
# sets a nice prompt
PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{240}%1~%f%b %# '
# maybe...?
export LC_ALL="en_US.UTF-8"
#adds powerline
#POWERLINE_PATH=$(which powerline-go)
# function powerline_precmd() {
# PS1="$($POWERLINE_PATH -error $? -shell zsh)"
# }
#
# function install_powerline_precmd() {
# for s in "${precmd_functions[@]}"; do
# if [ "$s" = "powerline_precmd" ]; then
# return
# fi
# done
# precmd_functions+=(powerline_precmd)
# }
# if [ "$TERM" != "linux" ] && [ -f $POWERLINE_PATH ];then
# install_powerline_precmd
# fi
# adds autojump
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh
TRAPWINCH() {
zle && { zle reset-prompt; zle -R }
}
# have ** use fd and ignore .gitignore files
FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
_fzf_compgen_path() {
fd --type f . "$1"
}
# FZF config
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
#default to starting a new shell in tmux
# if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
# tmux attach || tmux new
#fi
# TODO: uninstalled npm because it slow down shell startup. Find a solution so I can install again.
# export NVM_DIR="/Users/itai/.nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# Automaticaly switch to version specified in .nvmrc
# autoload -U add-zsh-hook
# load-nvmrc() {
# local node_version="$(nvm version)"
# local nvmrc_path="$(nvm_find_nvmrc)"
#
# if [ -n "$nvmrc_path" ]; then
# local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
#
# if [ "$nvmrc_node_version" = "N/A" ]; then
# nvm install
# elif [ "$nvmrc_node_version" != "$node_version" ]; then
# nvm use
# fi
# elif [ "$node_version" != "$(nvm version default)" ]; then
# echo "Reverting to nvm default version"
# nvm use default
# fi
# }
# add-zsh-hook chpwd load-nvmrc
# load-nvmrc
# [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
#
#
# # Test if the shell is launched in Neovim's Terminal
# # prevent error: E117: Unknown function: stdpath
# # source:https://github.com/neovim/neovim/issues/9960
# if [[ -n "${NVIM_LISTEN_ADDRESS}" ]]
# then
# # TODO update the path each time Vim has a major upgrade
# export VIMRUNTIME=/usr/share/vim/vim81
# fi
#
#
export PATH=/opt/homebrew/bin:/Users/itai/Envs/workflows/bin:/Users/itai/.yarn/bin:/Users/itai/.config/yarn/global/node_modules/.bin:/Users/itai/.autojump/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/itai/.cargo/bin:/Applications/kitty.app/Contents/MacOS:/Users/itai/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/git:/Users/itai/.antigen/bundles/zsh-users/zsh-autosuggestions:/Users/itai/.antigen/bundles/zsh-users/zsh-completions:/Users/itai/.antigen/bundles/zsh-users/zsh-history-substring-search:/Users/itai/.antigen/bundles/wfxr/forgit:/Users/itai/bin:/usr/local/opt/fzf/bin:/usr/local/bin/aws_completer