This is where all my works in progress are going to go.
Expect it to be really messy.
This commit is contained in:
Case Duckworth 2020-06-02 21:53:52 -05:00
parent e55d438495
commit 7151ad9630
1 changed files with 37 additions and 0 deletions

37
wip/tab-compl.sh Normal file
View File

@ -0,0 +1,37 @@
#!/usr/bin/env bash
option_one() {
set -o emacs
bind 'set show-all-if-ambiguous on'
bind 'set completion-ignore-case on'
COMP_WORDBREAKS=${COMP_WORDBREAKS//:/}
bind 'TAB:dynamic-complete-history'
urls=(http://example.com http://sample.net http://example.org)
for i in "${urls[@]}"; do
history -s "$i"
done
echo "${urls[@]}"
compgen -W "${urls[@]}" http://sa
read -rep "> "
echo "$REPLY"
}
tab(){ # requires bash 4+
READLINE_LINE=foobar
READLINE_POINT="${#READLINE_LINE}"
}
option_two() {
set -o emacs
bind -x '"\t":"tab"'
read -rep "> "
}
option_two "$@"