feat: update fzf opts

This commit is contained in:
Benexl
2025-07-13 13:41:13 +03:00
parent 7c91288e6e
commit c5034a5829
2 changed files with 20 additions and 3 deletions

View File

@@ -4,9 +4,20 @@
--color=border:#262626,label:#aeaeae,query:#d9d9d9
--border=rounded
--border-label=''
--preview-window=border-rounded
--prompt='>'
--marker='>'
--pointer='◆'
--separator='─'
--scrollbar='│'
--layout=reverse
--cycle
--info=hidden
--height=100%
--bind=right:accept,ctrl-/:toggle-preview,ctrl-space:toggle-wrap+toggle-preview-wrap
--no-margin
+m
-i
--exact
--tabstop=1
--preview-window=border-rounded,left,35%,wrap
--wrap

View File

@@ -16,6 +16,13 @@ class FzfSelector(BaseSelector):
if not self.executable:
raise FileNotFoundError("fzf executable not found in PATH.")
_HEADER_COLOR = config.header_color.split(",")
self.header = "\n".join(
[
f"\033[38;2;{_HEADER_COLOR[0]};{_HEADER_COLOR[1]};{_HEADER_COLOR[2]};m{line}\033[0m"
for line in config.header_ascii_art.replace("\t", "").split("\n")
]
)
os.environ["FZF_DEFAULT_OPTS"] = self.config.opts
# You can prepare default opts here from the config
@@ -25,8 +32,7 @@ class FzfSelector(BaseSelector):
# Build command from base options and specific arguments
commands = []
commands.extend(["--prompt", f"{prompt.title()}: "])
if header:
commands.extend(["--header", header])
commands.extend(["--header", self.header, "--header-first"])
if preview:
commands.extend(["--preview", preview])