aboutsummaryrefslogtreecommitdiffstats
path: root/bash
diff options
context:
space:
mode:
authorjason2022-07-05 15:23:32 -0600
committerjason2022-07-05 15:23:32 -0600
commit9daa2b5aa785237d2265219c462e79d22c1c0e63 (patch)
tree489ce55004bada519f54d8bc33913bc6dbed04b5 /bash
parent14a4a7de50b44920728f3746276d899a6df771c2 (diff)
downloaddotfiles-9daa2b5aa785237d2265219c462e79d22c1c0e63.tar.gz
dotfiles-9daa2b5aa785237d2265219c462e79d22c1c0e63.zip
include support for git-prompt and git bash completion on os x
Diffstat (limited to 'bash')
-rw-r--r--bash/.bashrc35
1 files changed, 34 insertions, 1 deletions
diff --git a/bash/.bashrc b/bash/.bashrc
index 06a4c4a..01e5e04 100644
--- a/bash/.bashrc
+++ b/bash/.bashrc
@@ -1,5 +1,9 @@
1LC_ALL="en_US.UTF-8" 1LC_ALL="en_US.UTF-8"
2PS1="[\u@\[\e[38;5;148m\]\h\[\e[m\]:\[\e[36m\]\W\[\e[m\]\[\e[m\]]\[\e[m\]\$\[\e[m\] " 2# This PS1 is completed at the end, allowing statuses to be included between the directory and closing $
3PS1="[\u@\[\e[38;5;148m\]\h\[\e[m\]:\[\e[36m\]\W\[\e[m\]\[\e[m\]]\[\e[m\]"
4local END_PS1="\$\[\e[m\] "
5# This is the original PS1
6#PS1="[\u@\[\e[38;5;148m\]\h\[\e[m\]:\[\e[36m\]\W\[\e[m\]\[\e[m\]]\[\e[m\]\$\[\e[m\] "
3PATH="${HOME}/bin:${HOME}/.local/bin:${PATH}" 7PATH="${HOME}/bin:${HOME}/.local/bin:${PATH}"
4 8
5# Disable bash deprecation warning on OS X 9# Disable bash deprecation warning on OS X
@@ -157,6 +161,7 @@ alias define='sdcv'
157 161
158# Git Related 162# Git Related
159function delete-branches() { 163function delete-branches() {
164 # Interactive branch deleter
160 git branch | 165 git branch |
161 grep --invert-match '\*' | 166 grep --invert-match '\*' |
162 cut -c 3- | 167 cut -c 3- |
@@ -164,6 +169,31 @@ function delete-branches() {
164 xargs --no-run-if-empty git branch --delete --force 169 xargs --no-run-if-empty git branch --delete --force
165} 170}
166 171
172local XCODE_SELECT=`which xcode-select`
173if [[ -x $XCODE_SELECT ]]; then
174 local OSX_GIT_COMPLETION=`xcode-select -p`/usr/share/git-core/git-completion.bash
175 if [[ -f $OSX_GIT_COMPLETION ]]; then
176 source $OSX_GIT_COMPLETION
177 fi
178 local OSX_GIT_PROMPT=`xcode-select -p`/usr/share/git-core/git-prompt.sh
179 if [[ -f $OSX_GIT_PROMPT ]]; then
180 source $OSX_GIT_PROMPT
181 fi
182fi
183
184if [[ $(type -t __git_ps1) == function ]]; then
185 GIT_PS1_SHOWDIRTYSTATE=1 # Show unstaged and staged indicators
186 GIT_PS1_SHOWUNTRACKEDFILES=1 # show % for untracked files
187 # GIT_PS1_SHOWUPSTREAM=auto # show +/- changes with upstream
188 #PS1=$PS1'$(__git_ps1 " (%s)")'
189
190 # Alternatively, for a slightly faster prompt, __git_ps1 can be
191 # used for PROMPT_COMMAND in Bash with two parameters, <pre> and
192 # <post>, which are strings you would put in $PS1 before and after
193 # the status string generated by the git-prompt machinery.
194 export PROMPT_COMMAND="__git_ps1 '${PS1}' '${END_PS1}'; ${PROMPT_COMMAND}"
195fi
196
167# The Gemini earbuds don't sync the volume. This turns up the hardware volume control 197# The Gemini earbuds don't sync the volume. This turns up the hardware volume control
168alias geminiup="dbus-send --print-reply --system --dest=org.bluez /org/bluez/hci0/dev_7C_C4_EF_CC_45_43 org.bluez.MediaControl1.VolumeUp" 198alias geminiup="dbus-send --print-reply --system --dest=org.bluez /org/bluez/hci0/dev_7C_C4_EF_CC_45_43 org.bluez.MediaControl1.VolumeUp"
169alias geminidown="dbus-send --print-reply --system --dest=org.bluez /org/bluez/hci0/dev_7C_C4_EF_CC_45_43 org.bluez.MediaControl1.VolumeDown" 199alias geminidown="dbus-send --print-reply --system --dest=org.bluez /org/bluez/hci0/dev_7C_C4_EF_CC_45_43 org.bluez.MediaControl1.VolumeDown"
@@ -199,3 +229,6 @@ TERRAFORM=`which terraform`
199if [[ -x $TERRAFORM ]]; then 229if [[ -x $TERRAFORM ]]; then
200 complete -C $TERRAFORM terraform 230 complete -C $TERRAFORM terraform
201fi 231fi
232
233# Close off the PS1 with the $
234PS1=${PS1}${END_PS1}