-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
executable file
·116 lines (96 loc) · 3.51 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
# 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
# If you come from bash you might have to change your $PATH.
ZSH_DISABLE_COMPFIX=true
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="powerlevel10k/powerlevel10k"
COMPLETION_WAITING_DOTS="true"
DISABLE_UNTRACKED_FILES_DIRTY="true"
HIST_STAMPS="dd.mm.yyyy"
plugins=(
fnm
git
fzf
zsh-syntax-highlighting
zsh-autosuggestions
yarn
z
)
source $ZSH/oh-my-zsh.sh
export MANPATH="/usr/local/man:$MANPATH"
export LANG=en_US.UTF-8
export EDITOR='nvim'
export SSH_KEY_PATH="~/.ssh/rsa_id"
fzf-git-checkout() {
git branch | grep -v "^\*" | fzf --height=20% --reverse --info=inline | xargs git checkout
}
# 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="micro ~/.zshrc"
alias zshrc="nvim $HOME/.zshrc && source $HOME/.zshrc "
alias nvimrc="cd $HOME/.config/nvim/ && nvim init.lua && cd -"
alias ohmyzsh="code ~/.oh-my-zsh"
alias lazygit="lazygit --use-config-file='$HOME/.config/lazygit/config.yml'"
alias ls="eza"
alias ll="eza -l"
alias ns="npm start"
alias gs="git status"
alias glog="git log 2>/dev/null || cat log.out 2>/dev/null"
alias py3="python3"
alias cse="ssh cse"
alias gb='fzf-git-branch'
alias gco='fzf-git-checkout'
alias site="ssh site"
alias gcm="git add . && gc -m"
alias gcp='(){ gaa && gc -m $1 && gp;}'
alias untar="tar -xvf"
alias gcl="git clone"
alias gpl="git pull"
alias mkcd='(){ mkdir -p "$@" && cd "$@"; }'
alias p='(){ git pull origin $(git rev-parse --abbrev-ref HEAD);}'
alias f='(){ git fetch origin $(git rev-parse --abbrev-ref HEAD);}'
alias cr="cargo run"
export TERM=xterm-256color
fpath+=${ZDOTDIR:-~}/.zsh_functions
PATH=usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
export PATH=$PATH:"/opt/X11/bin":"$HOME/.local/bin:$HOME/.fzf/bin:$HOME/.cargo/bin:$HOME/bin:$HOME/.jenv/bin:$JAVA_HOME/bin"
# better zsh histroy
export HISTFILE=~/.zsh_history
export HISTFILESIZE=1000000000
export HISTSIZE=1000000000
export HISTTIMEFORMAT="[%F %T] "
setopt INC_APPEND_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_FIND_NO_DUPS
setopt HIST_IGNORE_SPACE
# other variables
export NVIM="$HOME/.config/nvim"
export FZF_DEFAULT_COMMAND='fd --type f --strip-cwd-prefix'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Automatically start the SSH agent if it's not already running
if [ ! -f /tmp/.ssh-agent ]; then
ssh-agent > /tmp/.ssh-agent
source /tmp/.ssh-agent > /dev/null
ssh-add ~/.ssh/id_rsa > /dev/null
else
source /tmp/.ssh-agent > /dev/null
fi
if which jenv > /dev/null; then eval "$(jenv init -)"; fi
export GPG_TTY=$(tty)
# https://github.com/nodejs/node/issues/52229
export CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT'
if [[ -f ~/.zshrc-$HOST ]]; then
[[ ! -f ~/.zshrc-$HOST.zwc || ~/.zshrc-$HOST -nt ~/.zshrc-$HOST.zwc ]] && { zcompile ~/.zshrc-$HOST;}
source ~/.zshrc-$HOST
fi