-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
82 lines (66 loc) · 2.41 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
source ~/.zprofile
# 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
# ZSH
export ZSH="${HOME}/.oh-my-zsh"
export ZSH_CUSTOM_PLUGIN="$ZSH/custom/plugins"
ZSH_THEME="powerlevel10k/powerlevel10k"
HIST_STAMPS="yyyy-mm-dd"
# WSL/Linux
if [ $OSTYPE = "linux-gnu" ]; then
plugins=(
zsh-autosuggestions
zsh-history-substring-search
z
zsh-syntax-highlighting
git
docker
docker-compose
)
fi
# Exports
export GPG_TTY=$TTY
export DOTFILES="$HOME/projects/dotfiles"
export FLYCTL_INSTALL="$HOME/.fly"
export GOPATH="$HOME/projects/go"
export BROWSER=wslview
# Path
export PATH="$HOME/.local/bin":"/usr/local/go/bin":"$HOME/projects/go/bin":"$FLYCTL_INSTALL/bin":$PATH
fpath=($fpath "$HOME/.zfunctions")
autoload -Uz compinit && compinit
autoload -Uz mkd py rfv
source $ZSH/oh-my-zsh.sh
# Aliases
source ~/.aliases
if [ -f ~/.work-aliases ]; then
source ~/.work-aliases
fi
# zsh-autosuggestions
source $ZSH_CUSTOM_PLUGIN/zsh-autosuggestions/zsh-autosuggestions.zsh
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
ZSH_AUTOSUGGEST_USE_ASYNC=true
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
bindkey '^ ' autosuggest-accept
# zsh-history-substring-search
source $ZSH_CUSTOM_PLUGIN/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $ZSH_CUSTOM_PLUGIN/zsh-history-substring-search/zsh-history-substring-search.zsh
bindkey '^[[A' history-substring-search-up # Up key
bindkey '^[[B' history-substring-search-down # Down key
# HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='fg=1' # not working
# HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='fg=1' # not working
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
(( ! ${+functions[p10k]} )) || p10k finalize
bindkey '^H' backward-kill-word
export NVM_DIR="$HOME/.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
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
eval "$(atuin init zsh)"
# https://github.com/junegunn/fzf
# Fuzzy finder
source <(fzf --zsh)