Bash git stuff without the deps

This commit is contained in:
Josh Sherman 2018-01-06 23:34:06 -06:00
parent 9d3efc0ad7
commit bcbc3b12ce
No known key found for this signature in database
GPG key ID: 55B058A80530EF22
2 changed files with 20 additions and 22 deletions

40
bashrc
View file

@ -3,25 +3,6 @@
export DOTFILES=$HOME/.dotfiles
export INCLUDES=$HOME/.local/share/dotfiles
RESET=$(tput sgr0)
BLUE=$(tput setaf 4)
GREY=$(tput setaf 244)
RED=$(tput setaf 1)
YELLOW=$(tput setaf 3)
GIT_PROMPT_BRANCH='$YELLOW'
GIT_PROMPT_PREFIX=''
GIT_PROMPT_SUFFIX=''
GIT_PROMPT_CLEAN=''
GIT_PROMPT_START_USER='\n$BLUE\w'
GIT_PROMPT_END_USER='\n$GREY$ $RESET'
GIT_PROMPT_END_ROOT='\n$GREY# $RESET'
source $INCLUDES/bash-git-prompt/gitprompt.sh
source $DOTFILES/env
source $DOTFILES/aliases
source $HOME/.fzf.bash
@ -34,4 +15,23 @@ bind 'set completion-ignore-case on'
bind 'set show-all-if-ambiguous on'
bind 'TAB:menu-complete'
PS1='\n$BLUE\w\n$GREY$ $RESET'
RESET=$(tput sgr0)
BLUE=$(tput setaf 4)
GREY=$(tput setaf 244)
RED=$(tput setaf 1)
YELLOW=$(tput setaf 3)
git_prompt() {
BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/*\(.*\)/\1/')
if [ ! -z $BRANCH ]; then
echo -n "$YELLOW$BRANCH"
if [ ! -z "$(git status --short)" ]; then
echo " ${RED}"
fi
fi
}
PS1='\n$BLUE\w$(git_prompt)\n$GREY$ $RESET'

View file

@ -44,8 +44,6 @@ mkdir -p \
$GITCLONE https://github.com/junegunn/fzf.git $DOTFZF
$DOTFZF/install --key-bindings --completion --no-update-rc
$GITCLONE https://github.com/magicmonty/bash-git-prompt.git $DOTLOCAL/bash-git-prompt
$GITCLONE https://github.com/zsh-users/zsh-autosuggestions.git $DOTLOCAL/zsh-autosuggestions
$GITCLONE https://github.com/zsh-users/zsh-completions.git $DOTLOCAL/zsh-completions
$GITCLONE https://github.com/olivierverdier/zsh-git-prompt.git $DOTLOCAL/zsh-git-prompt