-
Notifications
You must be signed in to change notification settings - Fork 2
/
zshrc
97 lines (83 loc) 路 2.48 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
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
# themes and prompt
ZSH_THEME="powerlevel10k/powerlevel10k"
POWERLEVEL9K_MODE="awesome-patched"
# list of plugins to load
plugins=(
auto-ls
golang
vi-mode
zsh-interactive-cd
zsh-autosuggestions
zsh-syntax-highlighting
z
fzf-tab
)
unsetopt autocd
# Path to your oh-my-zsh installation.
export ZSH="${HOME}/.oh-my-zsh"
source $ZSH/oh-my-zsh.sh
unalias -m '*'
# options to use vi-mode from command line
VI_MODE_SET_CURSOR=true
bindkey -M vicmd ' ' edit-command-line
bindkey -M vicmd 'H' vi-beginning-of-line
bindkey -M vicmd 'L' vi-end-of-line
bindkey -M vicmd -s E 10e
bindkey -M vicmd -s B 10b
bindkey -M viins 'jj' vi-cmd-mode
bindkey -M viins 'kk' vi-cmd-mode
# exporting environment variables
export XDG_CONFIG_HOME="$HOME/.config"
export EDITOR="nvim"
export LANG=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export FZF_DEFAULT_OPTS='--reverse --border -e --height=50% --padding=1 --preview-window=right:50%:wrap --bind shift-up:preview-up,shift-down:preview-down --bind ?:toggle-preview'
export FZF_DEFAULT_COMMAND="fd -H -t f -E '.git/'"
export NAVI_CONFIG="$HOME/.config/navi/config.yaml"
export LS_COLORS="$(vivid generate solarized-dark)"
export JIRA_API_TOKEN="v7xzI0EOgKSqJe5ilr4pC778"
# exporting go paths
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=${PATH}:$GOBIN
# alias
alias ..="cd .."
alias cut="gcut"
alias sed="gsed"
alias head="ghead"
alias ls="exa --tree --level=1"
alias view="preview_files"
alias todo="${EDITOR} ~/.todo"
alias zenith="zenith -d 0 -n 0"
alias du="dust"
alias jd="json_diff"
alias env="list_env"
alias goenv="list_goenv"
alias src="exec zsh"
alias calc="insect"
alias :q="exit"
unalias z 2> /dev/null
z() {
[ $# -gt 0 ] && _z "$*" && return
cd "$(_z -l 2>&1 | fzf --height 40% --nth 2.. --reverse --inline-info +s --tac --query "${*##-* }" | sed 's/^[0-9,.]* *//')"
}
## -----------------------
## additional source files
## -----------------------
# sourcing fzf custom functions
[ -f ~/.zshfun ] && source ~/.zshfun
# sourcing fzf keybindings
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
## --------
## bindkeys
## --------
bindkey -s '^p' 'find_files\n'
bindkey -s '^n' 'vifm\n'
bindkey -s '^h' 'search '
eval "$(navi widget zsh)"