summaryrefslogtreecommitdiff
path: root/zsh/.zshrc
diff options
context:
space:
mode:
Diffstat (limited to 'zsh/.zshrc')
-rw-r--r--zsh/.zshrc79
1 files changed, 49 insertions, 30 deletions
diff --git a/zsh/.zshrc b/zsh/.zshrc
index 07065c3..4805208 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -1,48 +1,35 @@
source ~/.config/zsh/antigen.zsh
-
-# if command -v git >/dev/null && [ ! -d ~/.config/zsh/powerlevel10k ]; then
-# echo "info: installing p10k"
-# git clone --depth 1 --single-branch https://github.com/romkatv/powerlevel10k.git ~/.config/zsh/powerlevel10k
-# fi
-#
-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
-
-source ~/.config/zsh/theme/powerlevel10k.zsh-theme
source ~/.config/zsh/conf.d/*.zsh
source ~/.config/zsh/termsupport.zsh
source ~/.config/zsh/title.zsh
-foreground () { fg }
-zle -N foreground
-clearscr () { clear }
-zle -N clearscr
-
-antigen bundle zsh-users/zsh-syntax-highlighting
-antigen bundle zsh-users/zsh-history-substring-search
-antigen bundle zsh-users/zsh-autosuggestions
-antigen bundle zsh-users/zsh-completions
-antigen bundle ael-code/zsh-colored-man-pages
-antigen apply
# {{{ Exports
-#export GOPROXY=https://proxy.neonxp.ru
+export GOPROXY=https://goproxy.ru,direct
+export GONOPROXY=*.sovcombank.group
+export GOSUMDB=off
export GOPRIVATE=devopar.hippoparking.ru,gitlab.sovcombank.group
export EDITOR="nvim"
#export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock
-export ANDROID_HOME=$HOME/projects/android/
+export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
-export PATH=$PATH:~/.local/bin:~/go/bin:~/.cargo/bin
-export GOBIN=~/go/bin
+export GOPATH=~/go
+export PATH=$PATH:~/.local/bin:$GOPATH/bin #:~/.cargo/bin:~/.config/v-analyzer/bin:~/projects/tinygo/bin
+export GOBIN=$GOPATH/bin
export GPG_TTY=$(tty)
export LS_OPTIONS='--color=auto'
-export ZK_NOTEBOOK_DIR=$HOME/Документы/notebook/
+
eval "$(dircolors -b)"
-fpath+="~/.config/zsh/comp"
# }}}
+antigen bundle zsh-users/zsh-syntax-highlighting
+antigen bundle zsh-users/zsh-history-substring-search
+antigen bundle zsh-users/zsh-autosuggestions
+antigen bundle zsh-users/zsh-completions
+antigen bundle ael-code/zsh-colored-man-pages
+antigen apply
+
# {{{ Aliases
alias ls='ls $LS_OPTIONS -F'
alias l='ls $LS_OPTIONS -F'
@@ -63,12 +50,42 @@ alias g=git
alias share='wl-paste | curl -si -d @- https://nixshare.ru/paste/clipboard.txt | grep "location:" | sed -s "s/location: //" | wl-copy'
alias p=python3
alias t=todo.sh
+alias ed=gnome-text-editor
[[ ! -f `which exa` ]] || alias ls="exa" && alias ll="exa -l"
compdef _todo t
# }}}
# {{{ Functions
+foreground () { fg }
+zle -N foreground
+clearscr () { clear }
+zle -N clearscr
+
+
function tk() { mkdir -p $1; cd $1; }
+function powerline_precmd() {
+ PS1="$($GOPATH/bin/powerline-go -hostname-only-if-ssh -cwd-max-depth 1 -cwd-mode dironly -error $? -jobs ${${(%):%j}:-0})"
+
+ # Uncomment the following line to automatically clear errors after showing
+ # them once. This not only clears the error for powerline-go, but also for
+ # everything else you run in that shell. Don't enable this if you're not
+ # sure this is what you want.
+
+ set "?"
+}
+
+function install_powerline_precmd() {
+ for s in "${precmd_functions[@]}"; do
+ if [ "$s" = "powerline_precmd" ]; then
+ return
+ fi
+ done
+ precmd_functions+=(powerline_precmd)
+}
+
+if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then
+ install_powerline_precmd
+fi
# }}}
# {{{ Options section
@@ -108,9 +125,12 @@ HISTSIZE=100000
SAVEHIST=100000
WORDCHARS=${WORDCHARS//\/[&.;]}
+fpath=(~/.config/zsh/comp $fpath)
autoload -U compinit colors zcalc
compinit -d
+autoload -Uz compinit && compinit
+
autoload -U add-zsh-hook
add-zsh-hook precmd mzc_termsupport_precmd
add-zsh-hook preexec mzc_termsupport_preexec
@@ -157,7 +177,7 @@ bindkey "^z" foreground
bindkey "^ " autosuggest-accept
-bindkey "^k" clearscr
+bindkey "^K" clearscr
# }}}
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
@@ -166,5 +186,4 @@ ZSH_THEME_TERM_TITLE_IDLE="%n@%m:%~"
source ~/.config/zsh/theme.zsh
[[ ! -f env.sh ]] || source ./env.sh
[[ ! -f ~/.zshrc.local.zsh ]] || source ~/.zshrc.local.zsh
-[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# }}}