-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
153 lines (129 loc) · 4.93 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
146
147
148
149
150
151
152
153
# 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
export LC_ALL=en_US.UTF-8
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Shell prompt
if [ "$TERM_PROGRAM" = "WarpTerminal" ]; then
echo "[INFO] starship prompt is disabled in Warp terminal"
else
eval "$(starship init zsh)"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Add at or near the top of your .zshrc file (before any calls to compdef)
source /opt/homebrew/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh
# use either zsh-autocomplete or compinit
# autoload -U compinit; compinit
# ASDF
. /opt/homebrew/opt/asdf/libexec/asdf.sh
# tabtab source for serverless package
# uninstall by removing these lines or running `tabtab uninstall serverless`
[[ -f /Users/dmitrijsvecov/TempProjects/aws_serverless_try/node_modules/tabtab/.completions/serverless.zsh ]] && . /Users/dmitrijsvecov/TempProjects/aws_serverless_try/node_modules/tabtab/.completions/serverless.zsh
# tabtab source for sls package
# uninstall by removing these lines or running `tabtab uninstall sls`
[[ -f /Users/dmitrijsvecov/TempProjects/aws_serverless_try/node_modules/tabtab/.completions/sls.zsh ]] && . /Users/dmitrijsvecov/TempProjects/aws_serverless_try/node_modules/tabtab/.completions/sls.zsh
# tabtab source for slss package
# uninstall by removing these lines or running `tabtab uninstall slss`
[[ -f /Users/dmitrijsvecov/.npm/_npx/97826/lib/node_modules/serverless/node_modules/tabtab/.completions/slss.zsh ]] && . /Users/dmitrijsvecov/.npm/_npx/97826/lib/node_modules/serverless/node_modules/tabtab/.completions/slss.zsh
# export MANPATH="/usr/local/man:$MANPATH"
# export LESS="-X"
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
#
# Bindings ZSH and ZLE
# custom bindings are made to mimic readline/bash experience
# more info https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html
#
# ^ char - control key
# ^[ seq - option key
bindkey '^A' beginning-of-line
# CRTL + right-arrow
bindkey '^[[1;5C' end-of-line
bindkey '^E' end-of-line
# CRTL + left-arrow
bindkey '^[[1;5D' beginning-of-line
bindkey '^K' kill-line
bindkey '^A' beginning-of-line
bindkey '^W' backward-kill-word
bindkey '^[d' delete-word
bindkey '^U' kill-whole-line
# OPT + right-arrow
bindkey '^[[1;3C' forward-word
bindkey '^[f' forward-word
# OPT + left-arrow
bindkey '^[[1;3D' backward-word
bindkey '^[b' backward-word
# Enable CRTL+x CRTL+e combination to continue editing line in the $EDITOR
autoload -z edit-command-line
zle -N edit-command-line
bindkey "^X^E" edit-command-line
#
# fzf configuration
# make sure it is installed with homebrew `brew install fzf`
#
export FZF_DEFAULT_COMMAND='fd --type f --hidden'
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
#
# Atuin configuration
# make sure it is installed with homebrew `brew install atuin`
# https://docs.atuin.sh/
#
# must be after `fzf` configuration to keep CTRL-R keybing for Atuin
#
if [ "$TERM_PROGRAM" = "WarpTerminal" ]; then
echo "[INFO] atuin is disabled in Warp terminal"
else
eval "$(atuin init zsh --disable-up-arrow)"
fi
export PATH=$PATH:~/Projects/personal/git-scripts
export PATH=$PATH:~/Projects/personal/utils
export PATH=$PATH:~/bin
# Postgres libql & client
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
export PATH="/usr/local/opt/solana/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/libpq/lib"
export CPPFLAGS="-I/usr/local/opt/libpq/include"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
#
# pkgx shell integration
#
if which pkgx &> /dev/null; then
source <(pkgx --shellcode)
fi
#
# Shell extensions
#
function open_command() {
local open_cmd
# define the open command
case "$OSTYPE" in
darwin*) open_cmd='open' ;;
cygwin*) open_cmd='cygstart' ;;
linux*) [[ "$(uname -r)" != *icrosoft* ]] && open_cmd='nohup xdg-open' || {
open_cmd='cmd.exe /c start ""'
[[ -e "$1" ]] && { 1="$(wslpath -w "${1:a}")" || return 1 }
} ;;
msys*) open_cmd='start ""' ;;
*) echo "Platform $OSTYPE not supported"
return 1
;;
esac
${=open_cmd} "$@" &>/dev/null
}
# Open the node api for your current version to the optional section.
function nodejsdocs {
local section=${1:-all}
open_command "https://nodejs.org/docs/$(node --version)/api/$section.html"
}