diff options
| -rw-r--r-- | .bash_inputrc | 5 | ||||
| -rw-r--r-- | .bash_prompt | 48 |
2 files changed, 38 insertions, 15 deletions
diff --git a/.bash_inputrc b/.bash_inputrc new file mode 100644 index 0000000..f3fc295 --- /dev/null +++ b/.bash_inputrc @@ -0,0 +1,5 @@ +set blink-matching-paren +set colored-completion-prefix on +set colored-stats on +set enable-active-region on +set skip-completed-text diff --git a/.bash_prompt b/.bash_prompt index 0cd8d4b..4777251 100644 --- a/.bash_prompt +++ b/.bash_prompt @@ -81,6 +81,7 @@ __fontify () local -A codes=( [bold]=1 [dim]=2 + [reverse]=7 [red]=31 [green]=32 [blue]=34 @@ -204,24 +205,41 @@ __refresh-terminal () __set-prompt } +__init-smart () +{ + ### Prompts. -PS2='… ' + PS2=$(__fontify '… ' dim) + export PS4=$(__fontify "${PS4}" reverse) -if [ "${TERM}" = dumb ] -then - PS1='$? \u:\w\$ ' - return -fi + if __have-gitprompt + then + . /usr/lib/git-core/git-sh-prompt + GIT_PS1_SHOWDIRTYSTATE=t + GIT_PS1_SHOWUPSTREAM=auto -PS2=$(__fontify "${PS2}" dim) + PS1_SHOWGITSTATUS=t + fi -if __have-gitprompt -then - . /usr/lib/git-core/git-sh-prompt - GIT_PS1_SHOWDIRTYSTATE=t - GIT_PS1_SHOWUPSTREAM=auto + PROMPT_COMMAND=__refresh-terminal - PS1_SHOWGITSTATUS=t -fi + ### Bindings. + + bind -f ~/.bash_inputrc -PROMPT_COMMAND=__refresh-terminal + # Unset the TTY's "stop" char, so that readline receives C-s. + if tty -s + then + stty stop '' + fi +} + + +if [ "${TERM}" = dumb ] +then + PS1='$? \u:\w\$ ' + PS2='> ' + export PS4='+ ' +else + __init-smart +fi |
