add macbook vim/zsh initial

Change-Id: I3e492fecfb97756ab0f5d41bd6931cdfabfd51a2
This commit is contained in:
Simonas Narbutas
2018-07-09 17:10:20 +02:00
parent e8b850e9d0
commit 8268bdc934
7 changed files with 209 additions and 0 deletions

6
.zsh.d/00-path.zsh Normal file
View File

@@ -0,0 +1,6 @@
for dir in /usr/bin /usr/sbin /sbin /bin /Users/snarbutas/Desktop/sqlline-master/bin /Users/snarbutas/temp/platform-tools; do
if test -d "$dir" && ! grep -q -e "^${dir}:" -e ":${dir}:" -e ":${dir}" <<< $PATH; then
PATH="${dir}:${PATH}"
fi
done
export PATH

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=~/Documents/dev/go
export PATH=${PATH}:${GOPATH}/bin
fi

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

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

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

@@ -0,0 +1,19 @@
if ls --color=auto >&/dev/null; then
alias ls='ls -F --color=auto'
else
alias ls='ls -F'
fi
alias ll='ls -ltrh'
if grep --color=auto >&/dev/null; then
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
fi
if which vim > /dev/null; then
alias vi='vim'
fi
alias find='noglob find'
alias git='noglob git'
alias history='history -100'

13
.zsh.d/20-ssh.zsh Normal file
View File

@@ -0,0 +1,13 @@
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` $*
}
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"
}