fzf icon indicating copy to clipboard operation
fzf copied to clipboard

[Feature Request] Making `-r` a shorthand for `--layout=reverse`

Open SpaceshipOperations opened this issue 2 years ago • 2 comments

  • [x] I have read through the manual page (man fzf)
  • [x] I have the latest version of fzf
  • [x] I have searched through the existing issues

Info

  • OS
    • [x] Linux
    • [ ] Mac OS X
    • [ ] Windows
    • [ ] Etc.
  • Shell
    • [x] bash
    • [ ] zsh
    • [ ] fish

Problem / Steps to reproduce

As someone who always uses FZF with --layout=reverse, I both wonder why it's not the default and whole-heartedly welcome a way to make enabling it take less keystrokes.

-r seems like a reasonable short name to me, and upon invoking fzf --help | grep -- -r, there does not seem to be any other option already using this short name.

Would really appreciate it if it's supported in future versions.

Thank you in advance.

SpaceshipOperations avatar Apr 04 '23 21:04 SpaceshipOperations

Why don't you put it in your $FZF_DEFAULT_OPTS?

junegunn avatar Apr 05 '23 02:04 junegunn

Not gonna lie, I skimmed and searched the man page for something about a configuration file but didn't find any, so I assumed there was simply no way to globally configure FZF (save for using a bash alias or the like). So thank you for telling me about the environment variable, it did solve my immediate need to type less keys in an interactive shell session...

That said, this solution obviously cannot be carried over to scripts, since an environment variable or even configuration file are local to the current machine, so e.g. if one adopts what I think would be a terrible practice of writing scripts with the assumption that certain FZF configurations exist, these expectations will be broken as soon as the script is shared with others or moved to a different machine.

Yet at the same time, I'm aware that "I need to type 9 less keys inside a script" might not be much of case to be making here. So in all honesty my personal investment in the matter is largely diminished. You can mark the issue as solved if you want. I do still think that it would be a nice shorthand to have, but it's up to you to decide.

Thank you again.

SpaceshipOperations avatar Apr 05 '23 20:04 SpaceshipOperations