From dd57eafd440c343298859394973e8f5fcde8f3a8 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 21 Aug 2014 13:02:05 -0700 Subject: [PATCH] Add update_dotfiles. --- dotfiles/lib/shellrc/aliases.sh | 1 - dotfiles/lib/shellrc/functions.sh | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dotfiles/lib/shellrc/aliases.sh b/dotfiles/lib/shellrc/aliases.sh index 7eb57569..c241e90e 100644 --- a/dotfiles/lib/shellrc/aliases.sh +++ b/dotfiles/lib/shellrc/aliases.sh @@ -3,7 +3,6 @@ alias xemacs="\emacs --daemon > /dev/null 2&> /dev/null; emacsclient -c &" alias tmux="tmux -2" alias tmux_cb_to_remote_cb='tmux saveb - | linux_nc_paste_to_remote_clipboard' alias timestamp='date +%s' -alias go2dotfiles='cd $(dirname `readlink -f ~/.zshrc | xargs dirname`)' alias fn='find . -name ' alias prj='cd ~/Projects' alias reload_tmux='tmux source-file ~/.tmux.conf' diff --git a/dotfiles/lib/shellrc/functions.sh b/dotfiles/lib/shellrc/functions.sh index 5d058e3c..49b8710f 100644 --- a/dotfiles/lib/shellrc/functions.sh +++ b/dotfiles/lib/shellrc/functions.sh @@ -1,3 +1,14 @@ +function go2dotfiles() { + cd $(dirname `readlink -f ~/.zshrc | xargs dirname`) +} + +function update_dotfiles() { + local old_pwd=$(pwd) + go2dotfiles + git ffo + cd $old_pwd +} + function current_shell() { readlink -f $(which "$(ps -p $$ | tail -1 | awk '{print $NF}' | sed 's/\-//')") }