-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve hx fish completion #10853
Merged
archseer
merged 4 commits into
helix-editor:master
from
yuntaz0:feature/ImproveFishCompletion
Jul 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,15 +1,18 @@ | ||
#!/usr/bin/env fish | ||
# Fish completion script for Helix editor | ||
|
||
set -l langs (hx --health |tail -n '+7' |awk '{print $1}' |sed 's/\x1b\[[0-9;]*m//g') | ||
|
||
complete -c hx -s h -l help -d "Prints help information" | ||
complete -c hx -l tutor -d "Loads the tutorial" | ||
complete -c hx -l health -x -a "$langs" -d "Checks for errors in editor setup" | ||
complete -c hx -s g -l grammar -x -a "fetch build" -d "Fetches or builds tree-sitter grammars" | ||
complete -c hx -l health -xa "(__hx_langs_ops)" -d "Checks for errors in editor setup" | ||
complete -c hx -s g -l grammar -x -a "fetch build" -d "Fetch or build tree-sitter grammars" | ||
complete -c hx -s v -o vv -o vvv -d "Increases logging verbosity" | ||
complete -c hx -s V -l version -d "Prints version information" | ||
complete -c hx -l vsplit -d "Splits all given files vertically into different windows" | ||
complete -c hx -l hsplit -d "Splits all given files horizontally into different windows" | ||
complete -c hx -s c -l config -r -d "Specifies a file to use for completion" | ||
complete -c hx -l log -r -d "Specifies a file to write log data into" | ||
complete -c hx -l vsplit -d "Splits all given files vertically" | ||
complete -c hx -l hsplit -d "Splits all given files horizontally" | ||
complete -c hx -s c -l config -r -d "Specifies a file to use for config" | ||
complete -c hx -l log -r -d "Specifies a file to use for logging" | ||
complete -c hx -s w -l working-dir -d "Specify initial working directory" -xa "(__fish_complete_directories)" | ||
|
||
function __hx_langs_ops | ||
hx --health | tail -n '+7' | awk '{print $1}' | sed 's/\x1b\[[0-9;]*m//g' | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this chain needs some work too. The
+7
is too small - it was probably correct at the time but we have added more information to the--health
output since. It could usehx --health languages
and chop off the header instead.Since
--health
now shows multiple language servers this also includes some check or x characters that should be removed