-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement fish bridge, template system depending on $SHELL
- Loading branch information
Showing
8 changed files
with
123 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.completions/tt | ||
.tern-port | ||
src/ | ||
.completions/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
###-begin-{pkgname}-completion-### | ||
if type complete &>/dev/null; then | ||
_{pkgname}_completion () { | ||
local words cword | ||
if type _get_comp_words_by_ref &>/dev/null; then | ||
_get_comp_words_by_ref -n = -n @ -w words -i cword | ||
else | ||
cword="$COMP_CWORD" | ||
words=("${COMP_WORDS[@]}") | ||
fi | ||
|
||
local si="$IFS" | ||
IFS=$'\n' COMPREPLY=($(COMP_CWORD="$cword" \ | ||
COMP_LINE="$COMP_LINE" \ | ||
COMP_POINT="$COMP_POINT" \ | ||
{completer} completion -- "${words[@]}" \ | ||
2>/dev/null)) || return $? | ||
IFS="$si" | ||
} | ||
complete -o default -F _{pkgname}_completion {pkgname} | ||
fi | ||
###-end-{pkgname}-completion-### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
###-begin-{pkgname}-completion-### | ||
function _{pkgname}_completion | ||
set cmd (commandline -opc) | ||
set cursor (commandline -C) | ||
eval env DEBUG=\"" \"" COMP_CWORD=\""$cmd\"" COMP_LINE=\""$cmd"\" COMP_POINT="\"$cursor"\" {completer} completion -- $cmd | ||
end | ||
|
||
complete -c {pkgname} -a "(_{pkgname}_completion)" | ||
###-end-{pkgname}-completion-### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
###-begin-{pkgname}-completion-### | ||
if type compdef &>/dev/null; then | ||
_{pkgname}_completion() { | ||
local si=$IFS | ||
compadd -- $(COMP_CWORD=$((CURRENT-1)) \ | ||
COMP_LINE=$BUFFER \ | ||
COMP_POINT=0 \ | ||
{completer} completion -- "${words[@]}" \ | ||
2>/dev/null) | ||
IFS=$si | ||
} | ||
compdef _{pkgname}_completion {pkgname} | ||
elif type compctl &>/dev/null; then | ||
_{pkgname}_completion () { | ||
local cword line point words si | ||
read -Ac words | ||
read -cn cword | ||
let cword-=1 | ||
read -l line | ||
read -ln point | ||
si="$IFS" | ||
IFS=$'\n' reply=($(COMP_CWORD="$cword" \ | ||
COMP_LINE="$line" \ | ||
COMP_POINT="$point" \ | ||
{completer} completion -- "${words[@]}" \ | ||
2>/dev/null)) || return $? | ||
IFS="$si" | ||
} | ||
compctl -K _{pkgname}_completion {pkgname} | ||
fi | ||
###-end-{pkgname}-completion-### |