-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
165 lines (138 loc) · 4.29 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
154
155
156
157
158
159
160
161
162
163
164
165
start=$(date "+%s.%N")
zmodload zsh/zprof
#{{{zplug
source ~/.zplug/init.zsh
zplug "zsh-users/zsh-syntax-highlighting", defer:2
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-completions"
zplug "ssh0/dot", use:"*.sh"
#zplug "Aloxaf/fzf-tab", use:"*.plugin.zsh"
#zplug "junegunn/fzf-bin", from:gh-r, as:command, rename-to:fzf, use:"*linux*amd64*"
#zplug "junegunn/fzf", as:command, use:bin/fzf-tmux
zplug "modules/prompt", from:prezto
zplug "modules/history", from:prezto
zplug "modules/editor", from:prezto
zplug "tmuxinator/tmuxinator", use:"completion/tmuxinator.zsh"
#zplug "modules/directory", from:prezto
#zplug "modules/environment", from:prezto
#zplug "modules/git", from:prezto
#zplug "modules/spectrum", from:prezto
#zplug "modules/terminal", from:prezto
#zplug "modules/utility", from:prezto
zplug romkatv/powerlevel10k, as:theme, depth:1
#zplug "agkozak/zsh-z"
if [ ! ~/.zcheck -nt ~/.zshrc ]; then
touch ~/.zcheck
echo .zcheck
if ! zplug check --verbose; then
zplug install
fi
fi
zplug load
#}}}
export PATH="\
:$HOME/go/bin\
:$HOME/.local/bin\
:$HOME/local/bin\
:$HOME/dotfiles/scripts\
:$PATH"
if [ -d /usr/local/cuda-10.2 ]; then
source ~/dotfiles/scripts/CUDA9.2_ENV.sh
fi
if [ -d /usr/local/cuda-12.1 ]; then
export PATH="/usr/local/cuda-12.1/bin:${PATH}"
export LD_LIBRARY_PATH="/usr/local/cuda-12.1/lib64:${LD_LIBRARY_PATH}"
fi
export DOT_REPO="https://github.com/nat-chan/dotfiles"
export DOT_DIR="$HOME/dotfiles"
if [ -d ~/.zsh/dot ]; then
fpath=($HOME/.zsh/dot $fpath)
source $HOME/.zsh/dot/dot.sh
fi
if [ -d $HOME/.zsh/pueue ]; then
fpath=($HOME/.zsh/pueue $fpath)
fi
export MANPAGER="/bin/sh -c \"col -b -x|vim -R -c 'set colorcolumn=0 ft=man nolist nonu' -\""
export EDITOR="vi"
#{{{substring search
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^P" up-line-or-beginning-search # Up
bindkey "^N" down-line-or-beginning-search # Down
bindkey -e
#}}}
#{{{auto_pushd
# https://qiita.com/yoshikaw/items/e12e239afdbaaec78ec7
# https://qiita.com/sho-t/items/8e78d374512703cc2f38
DIRSTACKSIZE=100
setopt auto_pushd
setopt pushd_silent
setopt pushd_minus
# cd -<TAB>でセレクト時にハイライトされるが
# 起動時間が1sec遅くなる
autoload -Uz compinit && compinit
zstyle ':completion:*' menu select
zstyle ':completion:*:cd:*' ignore-parents parent pwd
zstyle ':completion:*:descriptions' format '%BCompleting%b %U%d%u'
#}}}
# https://qiita.com/yaotti/items/157ff0a46736ec793a91
setopt AUTO_CD
cdpath=(.. ../.. ~ /mnt/d)
set -o BSD_ECHO #デフォでecho -e <引数> するのをやめる
autoload zmv
win() {
windows_title=$(grep -i windows /boot/grub/grub.cfg | cut -d "'" -f 2)
sudo grub-reboot "$windows_title" && sudo reboot
}
alias c='cursor'
alias q='pueue'
alias qa='pueue add --'
alias zmv='noglob zmv -W'
alias mux=tmuxinator
alias p="/usr/local/bin/proxychains4 -q"
if [ -e ~/miniconda3/bin/tmux ] ; then
alias tmux='~/miniconda3/bin/tmux -2'
else
alias tmux='tmux -2'
fi
alias rm=rm
if [ -e ~/.cargo/bin/exa ]; then
alias ls='exa --group-directories-first --color=auto --icons'
else
alias ls='ls --color'
fi
alias gi='vim +Gstatus'
alias concrete="conda env create --force --file"
source ~/dotfiles/scripts/vivid.sh
autoload -Uz bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-magic
source ~/dotfiles/scripts/agent_client.sh
source $HOME/.cargo/env
eval "$($HOME/miniconda3/bin/conda shell.zsh hook)"
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
#if [ -d $HOME/.vscode-server ]; then
# for p in $HOME/.vscode-server/bin/*/bin; do
# export PATH="$p:$PATH"
# done
#fi
export BETTER_EXCEPTIONS=1
export HISTFILE=${HOME}/.zsh_history
export HISTSIZE=100000
export SAVEHIST=100000
setopt extended_history
autoload -Uz bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-magic
# 便利
zstyle :bracketed-paste-magic paste-init backward-extend-paste
winboot () {
windows_title=$(grep -i windows /boot/grub/grub.cfg | cut -d "'" -f 2)
sudo grub-reboot "$windows_title" && sudo reboot
}
hname=$(hostname -I|grep -oP '(?<=192.168.0.1)\d*')
[ -z "$hname" ]&&hname=$HOST
echo -ne "\033]0;${hname}\007"
end=$(date "+%s.%N")
echo $((end-start))