First commit
This commit is contained in:
31
modules/tty/config/gitprompt.sh
Normal file
31
modules/tty/config/gitprompt.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
_git () {
|
||||
if git branch --show-current > /dev/null 2>&1
|
||||
then
|
||||
_BRANCH="$(git branch --show-current)"
|
||||
_MODIFIED="$(grep -o "M" <<< "$(git status --short)" | grep -c .)"
|
||||
_UNTRACKED="$(grep -o "??" <<< "$(git status --short)" | grep -c .)"
|
||||
_ORIGIN="$(git remote show)"
|
||||
_AHEAD=$(git rev-list --left-right --count "$_BRANCH"..."$_ORIGIN"/"$_BRANCH" 2> /dev/null | cut -f 1)
|
||||
_BEHIND=$(git rev-list --left-right --count "$_BRANCH"..."$_ORIGIN"/"$_BRANCH" 2> /dev/null | cut -f 2)
|
||||
printf " %s " "$_BRANCH"
|
||||
if (( _MODIFIED == 0 )) && (( _UNTRACKED == 0 )) && (( _AHEAD == 0 )) && (( _BEHIND == 0 ))
|
||||
then
|
||||
printf " "
|
||||
exit 0
|
||||
fi
|
||||
if (( _MODIFIED > 0 ))
|
||||
then
|
||||
printf "✗%s " "$_MODIFIED"
|
||||
fi
|
||||
if (( _UNTRACKED > 0 ))
|
||||
then
|
||||
printf "★%s " "$_UNTRACKED"
|
||||
fi
|
||||
if (( _AHEAD > 0 )); then
|
||||
printf "%s " "$_AHEAD"
|
||||
fi
|
||||
if (( _BEHIND > 0 )); then
|
||||
printf "%s " "$_BEHIND"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
26
modules/tty/config/inputrc
Normal file
26
modules/tty/config/inputrc
Normal file
@@ -0,0 +1,26 @@
|
||||
set bell-style none
|
||||
set meta-flag on
|
||||
set input-meta on
|
||||
set convert-meta off
|
||||
set output-meta on
|
||||
set colored-stats on
|
||||
set completion-ignore-case on
|
||||
set editing-mode emacs
|
||||
|
||||
"\e[A":history-search-backward
|
||||
"\e[B":history-search-forward
|
||||
|
||||
$if term=linux
|
||||
"\e[1~": beginning-of-line
|
||||
"\e[4~": end-of-line
|
||||
$endif
|
||||
|
||||
$if term=xterm
|
||||
"\e[1~": beginning-of-line
|
||||
"\e[4~": end-of-line
|
||||
$endif
|
||||
|
||||
$if term=rxvt-unicode
|
||||
"\e[7~": beginning-of-line
|
||||
"\e[8~": end-of-line
|
||||
$endif
|
||||
Reference in New Issue
Block a user