| File bashrc changed (mode: 100644) (index 5d92641..b04ac4b) |
| ... |
... |
function alias_completion { |
| 785 |
785 |
alias_completion |
alias_completion |
| 786 |
786 |
unset -f alias_completion |
unset -f alias_completion |
| 787 |
787 |
|
|
|
788 |
|
# ============================================================================== |
|
789 |
|
# binds |
|
790 |
|
|
|
791 |
|
# the bind won't work in non-interactive shell |
|
792 |
|
if [[ $- =~ .*i.* ]]; then |
|
793 |
|
# insert name of the current branch on Ctrl-X+b |
|
794 |
|
function _insert_branch() { |
|
795 |
|
local prefix=${READLINE_LINE::READLINE_POINT} |
|
796 |
|
local suffix=${READLINE_LINE:READLINE_POINT} |
|
797 |
|
local branch=$(b) |
|
798 |
|
READLINE_LINE=$prefix"$(b)"$suffix |
|
799 |
|
READLINE_POINT=$(( READLINE_POINT + ${#branch} )) |
|
800 |
|
} |
|
801 |
|
bind -x '"\C-xb": _insert_branch' |
|
802 |
|
fi |
|
803 |
|
|
| 788 |
804 |
# ============================================================================== |
# ============================================================================== |
| 789 |
805 |
# sourcing guard end |
# sourcing guard end |
| 790 |
806 |
|
|