From a37ec4100fd3c33b5899e845dfb7325819eebdbb Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Wed, 25 Mar 2015 23:04:24 -0700 Subject: [PATCH] Some tmux updates --- assets/default/dotfiles/bash_alias | 3 ++- assets/default/dotfiles/bash_profile | 14 +++++++++----- assets/default/dotfiles/tmux.conf | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/assets/default/dotfiles/bash_alias b/assets/default/dotfiles/bash_alias index 3158fe6..7052e69 100644 --- a/assets/default/dotfiles/bash_alias +++ b/assets/default/dotfiles/bash_alias @@ -1,10 +1,11 @@ # git +alias ga='git add $*' alias gc='git commit $*' alias gco='git checkout $*' +alias gd='git diff $*' alias gl='git log $*' alias gr='git rebase $*' alias gs='git status $*' -alias gd='git diff $*' alias tiga='tig --all' # cd diff --git a/assets/default/dotfiles/bash_profile b/assets/default/dotfiles/bash_profile index 11a1925..41474d9 100644 --- a/assets/default/dotfiles/bash_profile +++ b/assets/default/dotfiles/bash_profile @@ -26,23 +26,27 @@ if [[ "$DET_OS" == "mac" ]]; then fi fi -# Git Branch PS -function parse_git_branch { +# Set prompt to include some useful information +function ps_git_branch { ref=$(git symbolic-ref HEAD 2> /dev/null) || return echo " ("${ref#refs/heads/}")" } -function parse_atf_target { +function ps_atf_target { org=$(atf-target 2> /dev/null) || return echo " [$org]" } -function parse_force_target { +function ps_force_target { `git config force.use 2> /dev/null` || return org=$(force-target 2> /dev/null) || return echo " [$org]" } +function ps_host_name { + [ -z $TMUX ] || return && echo '\h ' +} + # Alias for colors RED="\[\033[0;31m\]" YELLOW="\[\033[0;33m\]" @@ -50,7 +54,7 @@ GREEN="\[\033[0;32m\]" ENDCOLOR="\[\e[0m\]" # New prompt format -PS1="\h \W$YELLOW\$(parse_git_branch)$ENDCOLOR$GREEN\$(parse_atf_target)\$(parse_force_target)$ENDCOLOR\$ " +PS1="$(ps_host_name)\W$YELLOW\$(ps_git_branch)$ENDCOLOR$GREEN\$(ps_atf_target)\$(ps_force_target)$ENDCOLOR\$ " # Prompt Title export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"' diff --git a/assets/default/dotfiles/tmux.conf b/assets/default/dotfiles/tmux.conf index 0a62b01..e548285 100644 --- a/assets/default/dotfiles/tmux.conf +++ b/assets/default/dotfiles/tmux.conf @@ -54,6 +54,7 @@ bind ` copy-mode unbind p bind p paste-buffer bind -t vi-copy v begin-selection +bind -t vi-copy V rectangle-toggle bind -t vi-copy y copy-selection # after copying to a tmux buffer, hit y again to copy to clipboard