Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:marshall/dotfiles

  • Loading branch information...
commit a981de494baa58535433b2b7e44fba44a1e2a8be 2 parents 074d8a5 + 6c406a8
@marshall authored
View
4 bootstrap/bootstrap_linux.sh
@@ -2,7 +2,7 @@
# Bootstrap a clean Linux environment with dependencies
set -e
-APT_PACKAGES=(zsh vim git-core grc)
+APT_PACKAGES=(zsh vim git-core grc ruby gem rake curl)
install_ack() {
run_cmd sudo apt-get install ack-grep
@@ -13,5 +13,5 @@ echo "apt-get requires sudo"
run_cmd sudo apt-get install ${APT_PACKAGES[@]}
echo "updating default shell to zsh"
-run_cmd sudo usermod --shell /usr/bin/zsh
+run_cmd sudo usermod --shell /usr/bin/zsh $USER
install_ack
View
2  mozilla/b2g_build_filters.awk
@@ -37,5 +37,5 @@ build_info == 3 { next }
}
{
print
- fflush
+ fflush()
}
View
2  ruby/ruby.zsh
@@ -1,3 +1,3 @@
# Add RVM to PATH for scripting
-PATH=$PATH:$HOME/.rvm/bin
+PATH=$PATH:$HOME/.rvm/bin:/var/lib/gems/1.8/bin
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
View
28 ssh/ssh.zsh
@@ -0,0 +1,28 @@
+setup_ssh_agent() {
+ # Try to find an existing ssh-agent before starting a new one
+ agent_pid=$(ps -ef | grep "ssh-agent" | grep -v "grep" | awk '{print $2}')
+
+ if [[ -z $agent_pid ]]; then
+ # None exists, start ssh-agent
+ eval "$(ssh-agent)"
+ else
+ agent_ppid=$(ps -ef | grep "ssh-agent" | grep -v "grep" | awk '{print $3}')
+ agent_sock=$(find /tmp -path "*ssh*" -type s -iname "agent.$agent_ppid" 2>/dev/null)
+ echo "[ssh-agent] PID: $agent_pid, Sock: $agent_sock"
+ export SSH_AGENT_PID="$agent_pid"
+ export SSH_AUTH_SOCK="$agent_sock"
+ fi
+
+ known_keys=$(ssh-add -l | awk '{print $3}')
+ cat ~/.ssh/config | grep IdentityFile | awk '{print $2}' | while read key; do
+ # Only ssh-add unknown identity files
+ (echo $known_keys | grep $key > /dev/null) && continue
+
+ echo "$fg[white]Adding ssh key $reset_color$fg[blue]$key$reset_color"
+ ssh-add $key
+ done
+}
+
+if [[ "$OS_NAME" = "Linux" ]]; then
+ setup_ssh_agent
+fi
View
8 zsh/vi-mode.zsh
@@ -3,12 +3,18 @@ function zle-keymap-select {
}
function zle-line-init {
- zle end-of-line
+ zle vi-end-of-line
zle reset-prompt
}
+function vi-up-line-or-history {
+ zle .vi-up-line-or-history
+ zle vi-end-of-line
+}
+
zle -N zle-line-init
zle -N zle-keymap-select
+zle -N vi-up-line-or-history
bindkey -v
Please sign in to comment.
Something went wrong with that request. Please try again.