Skip to content

FZF_DEFAULT_OPTS_FILE is incovenient #4768

@k4lizen

Description

@k4lizen

Problem

I want to set some options, I think using FZF_DEFAULT_OPTS is a bit annoying for various reasons (cannot comment the options, cannot save to dotfile manager), so I want to use FZF_DEFAULT_OPTS_FILE. I set it and set the two options that I want:

set -Ux FZF_DEFAULT_OPTS_FILE ~/.config/fzf/fzf.rc
# If press enter when fuzzy searching for a command that has no matches, places what I typed into the terminal instead of removing it;
--bind "enter:become:if test -n {}; echo {}; else; echo {q}; end"
# If do ctrl-c at any point during fzf, don't delete the query, instead keep what i have typed so far
--bind "ctrl-c:become:echo {q}"

But now, running fzf the ANSI characters are not being properly processed. I assume that this is because there is some default option that I essentially unset by setting FZF_DEFAULT_OPTS_FILE to my file.

Solution

I think having the FZF_DEFAULT_OPTS_FILE be in effect after the default options are already applied would be very sensible.

Alternatively, fzf could provide a command line flag like --dump-default-opts so I could do fzf --dump-default-ops > ~/.config/fzf/fzf.rc and then just additionally set my two custom options.

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