-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2064 from rsteube/mv-lazyinit
move lazyinit
- Loading branch information
Showing
12 changed files
with
331 additions
and
281 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
package lazyinit | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
func Bash(completers []string) string { | ||
snippet := `%v%v | ||
_carapace_lazy() { | ||
source <(carapace $1 bash) | ||
$"_$1_completion" | ||
} | ||
complete -F _carapace_lazy %v | ||
` | ||
return fmt.Sprintf(snippet, pathSnippet("bash"), envSnippet("bash"), strings.Join(completers, " ")) | ||
} | ||
|
||
func BashBle(completers []string) string { | ||
snippet := `%v | ||
_carapace_lazy() { | ||
source <(carapace $1 bash-ble) | ||
$"_$1_completion_ble" | ||
} | ||
complete -F _carapace_lazy %v | ||
` | ||
return fmt.Sprintf(snippet, pathSnippet("bash-ble"), strings.Join(completers, " ")) | ||
} |
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,20 @@ | ||
package lazyinit | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
func Elvish(completers []string) string { | ||
snippet := `%v | ||
put %v | each {|c| | ||
set edit:completion:arg-completer[$c] = {|@arg| | ||
set edit:completion:arg-completer[$c] = {|@arg| } | ||
eval (carapace $c elvish | slurp) | ||
$edit:completion:arg-completer[$c] $@arg | ||
} | ||
} | ||
` | ||
return fmt.Sprintf(snippet, pathSnippet("elvish"), strings.Join(completers, " ")) | ||
} |
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,23 @@ | ||
package lazyinit | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
func Fish(completers []string) string { | ||
snippet := `%v%v | ||
function _carapace_lazy | ||
complete -c $argv[1] -e | ||
carapace $argv[1] fish | source | ||
complete --do-complete=(commandline -cp) | ||
end | ||
%v | ||
` | ||
complete := make([]string, len(completers)) | ||
for index, completer := range completers { | ||
complete[index] = fmt.Sprintf(`complete -c '%v' -f -a '(_carapace_lazy %v)'`, completer, completer) | ||
} | ||
return fmt.Sprintf(snippet, pathSnippet("fish"), envSnippet("fish"), strings.Join(complete, "\n")) | ||
} |
Oops, something went wrong.