dotfiles

$HOME is where the <3 is
git clone git://git.alexkarle.com/dotfiles.git
Log | Files | Refs | Submodules | README

commit 8e533da62f434d5fd990bb1c2f08f3256f35d29e (patch)
parent 2caaf18dd9fa0fdfc003ae849ef7599581674684
Author: Alex Karle <alex@karle.co>
Date:   Tue, 19 Mar 2019 08:41:41 -0400

[bash] alias and prompt tweaks

For aliases, its good to wrap the __git_complete calls in a check to
make sure it exists.

For the prompt, large repos with slow git status' can be painful, in
these cases, the dirty bit can be opted out of.

Diffstat:
Mbash/aliases | 13+++++++++----
Mbash/bash_prompt | 4+++-
2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/bash/aliases b/bash/aliases @@ -25,12 +25,17 @@ alias gf='git fetch' alias glg='git log --stat' alias g_='git stash' alias g_p='git stash pop' +alias gb='git branch' +alias gr='git rebase' # Git completion for aliases -__git_complete ga _git_add -__git_complete gco _git_checkout -__git_complete gd _git_diff -__git_complete ga _git_add +if [ -n "$(type -t __git_complete)" ] && [ "$(type -t __git_complete)" == "function" ]; then + __git_complete ga _git_add + __git_complete gco _git_checkout + __git_complete gd _git_diff + __git_complete gr _git_rebase + __git_complete gb _git_branch +fi # Alias vim / vi to nvim if there if [ -x "$(command -v nvim)" ]; then diff --git a/bash/bash_prompt b/bash/bash_prompt @@ -17,7 +17,9 @@ if [ -n "$SSH_CLIENT" ]; then fi function parse_git_dirty() { - [ "$(git status --porcelain=v1 2> /dev/null)" ] && echo "*" + if [ -z "$BASH_PROMPT_NO_GSTATUS" ]; then + [ "$(git status --porcelain=v1 2> /dev/null)" ] && echo "*" + fi } function parse_git_branch() {