fix zsh.d files

This commit is contained in:
Simonas Narbutas
2019-11-22 12:49:39 +01:00
parent bb1363f92e
commit ad7f785f3b
9 changed files with 8 additions and 7 deletions

1
.zsh.d/00-path.zsh Symbolic link
View File

@@ -0,0 +1 @@
/home/snarbutas/.config/yadm/alt/.zsh.d/00-path.zsh##o.Linux,h.epiphanius

3
.zsh.d/10-rust.zsh Normal file
View File

@@ -0,0 +1,3 @@
if test -d "$HOME/.cargo/bin"; then
export PATH="${PATH}:$HOME/.cargo/bin"
fi

4
.zsh.d/11-go.zsh Normal file
View File

@@ -0,0 +1,4 @@
if which go 2>&1 > /dev/null; then
export GOPATH=~/development/go
export PATH=${PATH}:${GOPATH}/bin
fi

6
.zsh.d/15-ruby.zsh Normal file
View File

@@ -0,0 +1,6 @@
#for dir in ~/.rbenv/bin ~/.rbenv/shims ~/.gem/ruby/*/bin(ocN); do
# if test -d "$dir"; then
# export PATH="${PATH}:${dir}"
# fi
#done
#eval "$(rbenv init -)"

21
.zsh.d/20-aliases.zsh Normal file
View File

@@ -0,0 +1,21 @@
if ls --color=auto >&/dev/null; then
alias ls='ls -F --color=auto'
else
alias ls='ls -F'
fi
alias ll='ls -lh'
alias cat='bat'
if grep --color=auto >&/dev/null; then
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
fi
if which nvim > /dev/null; then
alias vi='nvim'
fi
alias find='noglob find'
alias git='noglob git'
alias history='history -2000'
alias gssh='gcloud compute ssh --ssh-flag "-J shd-gcp-jump-001.bolcom.net"'

30
.zsh.d/20-functions.zsh Normal file
View File

@@ -0,0 +1,30 @@
OS_TYPE=$(uname -s)
if [ "$OS_TYPE" = "Darwin" ]; then
PWDID=6731738634759616518
BID=snarbutas@BOLCOM.NET
function ssh() {
if ! kswitch -p "$BID"; then
lpass show --password "$PWDID" | kinit --password-file=STDIN "$BID"
elif klist -l | grep "*"|grep Expired; then
lpass show --password "$PWDID" | kinit --password-file=STDIN "$BID"
fi
eval TERM=screen `/usr/bin/which ssh` $*
}
fi
decrypt () {
ssh -qtt shd-puppet-server-001.bolcom.net "sudo /opt/puppetlabs/bin/puppetserver ruby /var/lib/puppetserver/jruby-gems/gems/hiera-eyaml-2.1.0/bin/eyaml decrypt -s "${1}" 2>/dev/null"
}
checkModuleVersion () {
if [ ! -z $1 ]
then
for branch in dev tst acc xpr pro adm shd sbx use master
do
echo "== $branch =="
git checkout -q $branch
git pull -q
grep -A2 "'$1'" Puppetfile
done
else
echo "!! no module provided"
fi
}

12
.zsh.d/40-always-tmux.zsh Normal file
View File

@@ -0,0 +1,12 @@
if [[ "$TERM" == screen-256color ]] || [[ -n "$TMUX" ]] || [[ "${TERM_PROGRAM}" == "vscode" ]]; then
return 1
fi
if tmux list-sessions && (tmux list-sessions | test -n "$0"); then
session_id=`date +%Y%m%d%H%M%S`
tmux new-session -d -t base -s $session_id
tmux select-window -t "$( tmux new-window -P -F \#{window_index} )"
tmux attach-session -t $session_id \; set-option destroy-unattached
else
tmux new-session -s base
fi

4
.zsh.d/50-env.zsh Normal file
View File

@@ -0,0 +1,4 @@
export BAT_THEME="dark_neon"
#export BAT_THEME="Monokai Extended"
export SPOTIFY_CLIENT=a9138a6b1082438fa196221f9da72617
export SPOTIFY_SECRET=1c6ea12d0ba7455a9de42c693c77bc47