Some tmux updates

This commit is contained in:
ViViDboarder 2015-03-25 23:04:24 -07:00
parent 921ebb8e8d
commit a37ec4100f
3 changed files with 12 additions and 6 deletions

View File

@ -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

View File

@ -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"'

View File

@ -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