Skip to content
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

Add possibility to skip interactive variable queries #699

Closed
carlfriedrich opened this issue Mar 6, 2022 · 6 comments · Fixed by #824
Closed

Add possibility to skip interactive variable queries #699

carlfriedrich opened this issue Mar 6, 2022 · 6 comments · Fixed by #824
Labels
new feature New feature or request

Comments

@carlfriedrich
Copy link
Contributor

I love navi's ability to interactivly query variable values. However, there are occasions where I'd like to skip this and instead print the whole command as-is (including its variable names) to the command line and modify it by hand.

Is that somehow possible? Optimal workflow would be a dedicated keybinding for it (e.g. Alt+Enter), so that I can decide this while the navi search dialog is open. I'm not sure how this would be possible on a technical level, since fzf does not offer different exit types (or does it?).

Any ideas how this could be done?

@carlfriedrich carlfriedrich added the new feature New feature or request label Mar 6, 2022
@carlfriedrich
Copy link
Contributor Author

I think this should be possible using fzf's --expect argument:

--expect=KEY[,..]
       Comma-separated list of keys that can be used to complete fzf in addition to  the  default  enter  key.
       When this option is set, fzf will print the name of the key pressed as the first line of its output (or
       as the second line if --print-query is also used). The line will be empty if fzf is completed with  the
       default  enter  key.  If  --expect option is specified multiple times, fzf will expect the union of the
       keys. --no-expect will clear the list.
 
       e.g.
            fzf --expect=ctrl-v,ctrl-t,alt-s --expect=f1,f2,~,@

@denisidoro
Copy link
Owner

There's also the --print flag

@carlfriedrich
Copy link
Contributor Author

@denisidoro Why are you closing this? I would still like to implement it, I just did not have the time, yet.
And what do you mean with the --print flag? Is this a flag of navi or fzf and how would that help in this case?

@denisidoro
Copy link
Owner

navi --print does what you're proposing, if my understanding is correct

@carlfriedrich
Copy link
Contributor Author

@denisidoro No, that doesn't do what I want. navi --print still queries the variables interactively. I want to be able to skip that. It is just not efficient in some scenarios, e.g. when the argument is a file, where I could use tab completion on the shell. This is not possible when the arguments are queried interactively.

@carlfriedrich
Copy link
Contributor Author

Hi @denisidoro, thanks for adding the new flag. Can you give me a hint how I would use this in combination with the shell widget?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants