Skip to content

Show completions' ToolTip as --preview #359

Description

@cspotcode

Would be nice to see CompletionMatches' .ToolTips in the fzf --preview-window.

Here's how I think this could work:

  • get array of completions
  • Generate JSON object: keys == CompletionText, values == ToolTip
  • Write JSON to a temp file
  • pass a command to fzf --preview that can lookup a value from a key in the JSON
    • If using jq, could be: fzf --preview 'jq --raw-output --arg key "{1}" ".[$key]" /path/to/tempfile.json'
    • relying on an external binary is not ideal
    • fzf might get support for reading directly from JSON, no need for external jq binary

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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