Skip to content

Feature request: allow overriding completion input for the Fish shell #4720

@llakala

Description

@llakala

Currently, the completion input for __fzf_complete_native is defined inline in the Fish completions:

set -l -- completions (eval complete -C \"$argv[1]\")

This means if the user wants to change the completions in any way, they have to rewrite all the logic of this function. The bash and zsh completions can read from $_fzf_compgen_path and $_fzf_compgen_dir, which allow the user to change the completion input. It would be quite simple to add a similar variable for fish. Since fish has no internal separation between path and directory completion, it could be named something like $_fzf_complete_fish.

I personally want this to align the description text. With the default Fish completion, the descriptions are right-aligned:

Image

While with the FZF completion, they're left-aligned.

Image

I wanted to right-align them again, but FZF doesn't provide alignment logic for specific columns. The easiest solution would be to preprocess the input by piping the eval complete output into printf. That's when I discovered that the fish completion didn't have any command overridability.

I'd be happy to resolve this in a PR if I get approval for the idea (and if nobody beats me to it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions