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 # git
alias ga='git add $*'
alias gc='git commit $*' alias gc='git commit $*'
alias gco='git checkout $*' alias gco='git checkout $*'
alias gd='git diff $*'
alias gl='git log $*' alias gl='git log $*'
alias gr='git rebase $*' alias gr='git rebase $*'
alias gs='git status $*' alias gs='git status $*'
alias gd='git diff $*'
alias tiga='tig --all' alias tiga='tig --all'
# cd # cd

View File

@ -26,23 +26,27 @@ if [[ "$DET_OS" == "mac" ]]; then
fi fi
fi fi
# Git Branch PS # Set prompt to include some useful information
function parse_git_branch { function ps_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo " ("${ref#refs/heads/}")" echo " ("${ref#refs/heads/}")"
} }
function parse_atf_target { function ps_atf_target {
org=$(atf-target 2> /dev/null) || return org=$(atf-target 2> /dev/null) || return
echo " [$org]" echo " [$org]"
} }
function parse_force_target { function ps_force_target {
`git config force.use 2> /dev/null` || return `git config force.use 2> /dev/null` || return
org=$(force-target 2> /dev/null) || return org=$(force-target 2> /dev/null) || return
echo " [$org]" echo " [$org]"
} }
function ps_host_name {
[ -z $TMUX ] || return && echo '\h '
}
# Alias for colors # Alias for colors
RED="\[\033[0;31m\]" RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]" YELLOW="\[\033[0;33m\]"
@ -50,7 +54,7 @@ GREEN="\[\033[0;32m\]"
ENDCOLOR="\[\e[0m\]" ENDCOLOR="\[\e[0m\]"
# New prompt format # 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 # Prompt Title
export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"' export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"'

View File

@ -54,6 +54,7 @@ bind ` copy-mode
unbind p unbind p
bind p paste-buffer bind p paste-buffer
bind -t vi-copy v begin-selection bind -t vi-copy v begin-selection
bind -t vi-copy V rectangle-toggle
bind -t vi-copy y copy-selection bind -t vi-copy y copy-selection
# after copying to a tmux buffer, hit y again to copy to clipboard # after copying to a tmux buffer, hit y again to copy to clipboard