From f50ee35f4c2a5f8b50c7501e94d8b233b4648e9d Mon Sep 17 00:00:00 2001 From: Blallo Date: Mon, 18 Nov 2019 15:36:09 +0100 Subject: [PATCH] Update configs. --- .zshrc | 133 +++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 105 insertions(+), 28 deletions(-) diff --git a/.zshrc b/.zshrc index 24d7775..4eb26b8 100644 --- a/.zshrc +++ b/.zshrc @@ -1,20 +1,43 @@ +#export ANTIGEN_CACHE=false +#case $(tty) in +# (/dev/tty[1-9]) _IS_TTY=1;; +# (*) _IS_TTY=0;; +#esac + +_IS_TTY=false +if [ -t 1 ]; then + if command -v tput >/dev/null; then + _IS_TTY=true + fi +fi + source /usr/share/zsh/share/antigen.zsh antigen use oh-my-zsh -antigen theme agnoster +if [[ ${_IS_TTY} -eq 0 ]]; then + antigen theme agnoster +else + antigen theme ys +fi + antigen bundle colored-man-pages antigen bundle docker -antigen bundle git +antigen bundle gitfast #antigen bundle tmux antigen bundle virtualenv #antigen bundle virtualenvwrapper antigen bundle ael-code/zsh-gpg-agent antigen bundle ael-code/zsh-plugin-fasd-fzf +antigen bundle ael-code/zsh-colored-man-pages antigen bundle gangleri/pipenv antigen bundle leophys/zsh-plugin-fzf-finder -#antigen bundle junegunn/fzf +antigen bundle bobthecow/git-flow-completion +if [[ $_IS_TTY -eq 0 ]]; then + antigen bundle zsh-users/zsh-autosuggestions +fi +antigen bundle junegunn/fzf @@ -35,17 +58,17 @@ eval "$(fasd --init auto)" _pipenv() { eval $(env COMMANDLINE="${words[1,$CURRENT]}" _PIPENV_COMPLETE=complete-zsh pipenv) } -if [[ "$(basename ${(%):-%x})" != "_pipenv" ]]; then - autoload -U compinit && compinit - compdef _pipenv pipenv -fi +#if [[ "$(basename ${(%):-%x})" != "_pipenv" ]]; then + #autoload -U compinit && compinit + #compdef _pipenv pipenv +#fi ## Set SSH to use gpg-agent -unset SSH_AGENT_PID -if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then - export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh" -fi +# unset SSH_AGENT_PID +# if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then +# export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh" +# fi ## Node and NVM export NVM_DIR=/home/leo/.nvm @@ -59,9 +82,9 @@ function nvm { ## Ruby and RVM [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* -export PATH=/home/leo/.gem/ruby/2.5.0/bin:$PATH -source /home/leo/.rvm/scripts/rvm -export rvmsudo_secure_path=1 +#export PATH=/home/leo/.gem/ruby/2.5.0/bin:$PATH +#source /home/leo/.rvm/scripts/rvm +#export rvmsudo_secure_path=1 # ## Taken from old .zshrc # @@ -86,27 +109,25 @@ export rvmsudo_secure_path=1 # fi # cd ~$dir # } -# -# pcat -alias pcat='pygmentize -f terminal256 -O style=native -g' # Fuckin' TERM env for ssh -function ssh { - if [[ "${TERM}" = tmux* ]]; then - env TERM=xterm /bin/ssh "$@" - else - /bin/ssh "$@" - fi -} +if [ "z${TMUX}" = "z" ]; then + function ssh { + TERM=xterm-color /bin/ssh "$@" + } +fi ## Misc export MANPATH="/usr/local/man:$MANPATH" -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib +export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH export EDITOR=vim # You may need to manually set your language environment -# export LANG=en_US.UTF-8 +export LANG=en_US.UTF-8 +if [[ ! -z $TMUX ]]; then + export TERM=tmux-256color +fi # Preferred editor for local and remote sessions # if [[ -n $SSH_CONNECTION ]]; then @@ -130,17 +151,28 @@ export EDITOR=vim # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" -## Flutter -export PATH=$PATH:/opt/flutter/bin/ +## ASDF +. /opt/asdf-vm/asdf.sh +. /opt/asdf-vm/completions/asdf.bash + +## Flutter && Dart +export ANDROID_SDK=/home/leo/Android/Sdk +export PATH=${ANDROID_SDK}/emulator:${ANDROID_SDK}/tools:${PATH} +export PATH=$PATH:/opt/flutter/bin/:"$HOME/.pub-cache/bin" ## Go export GOPATH=~/.go export PATH=$PATH:$GOPATH/bin +## Elixir + +export ERL_AFLAGS="-kernel shell_history enabled" + ## Aliases alias t="tmux -2" alias sy="systemctl" alias ssy="sudo systemctl" +alias syu="systemctl --user" alias sl="cmatrix -b -s" alias cd..="cmatrix -b -s -C yellow" alias lt="ls -lt" @@ -148,6 +180,16 @@ alias lh="ls -lh" alias la="ls -la" alias ll="ls -l" alias lrt="ls -lrt" +alias wgpg="gpg --homedir /home/leo/.gnupg-work" +alias agpg="gpg --homedir /home/leo/.gnupg-ai" + +# local bin + +export PATH=${PATH}:${HOME}/.local/bin + +# Completion + +eval "$(_CERTO_COMPLETE=source_zsh certo)" #ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh #if [[ ! -d $ZSH_CACHE_DIR ]]; then @@ -183,6 +225,12 @@ if [ -f /usr/bin/virtualenvwrapper_lazy.sh ]; then source /usr/bin/virtualenvwrapper_lazy.sh fi +# pyenv +# ----- + +#eval "$(pyenv init -)" +#eval "$(pyenv virtualenv-init -)" + # geoiplookup # ----------- @@ -192,6 +240,35 @@ alias geocityiplookup="geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat" # ---------- alias mutt="neomutt" +alias mailbundle="/opt/mailbundle/config/bin/autorun" +# torbrowser + +export PATH=$PATH:/opt/tor-browser_en-US + +# platform-tools +# -------------- + +export PATH=$PATH:/opt/android-sdk/platform-tools + +# TMP +# --- + +# export FZF_FINDER_BINDKEY='^F' + +function lookhosts { + if which rg 2>&1 > /dev/null; then + GREP=rg + else + GREP=grep + fi + ${GREP} $@ /etc/hosts +} + +function reload_work_gpg { + kill -9 $(ps aux|egrep "gpg-agent.*work"|grep -v grep|awk '{print $2}') +} + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh # vim: et sw=2 ts=2