Skip to content

Commit

Permalink
fix(fzf): Vendor fzf tokyonight themes
Browse files Browse the repository at this point in the history
See: folke/tokyonight.nvim#542

The tl;dr: is that the upstream themes take away control from the user
by setting the `--layout` option, because the `FZF_DEFAULT_OPTS` from
this flake will usually be sourced _after_ your own shell config.
  • Loading branch information
mrjones2014 committed Jun 12, 2024
1 parent b6b358f commit 6476a8e
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/home-manager/fzf.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{ inputs, config, lib, ... }:
{ config, lib, ... }:
let cfg = config.programs.fzf.tokyonight;
in {
options.programs.fzf.tokyonight = lib.tn.mkTokyonightOpt "tokyonight fzf";
config = lib.mkMerge [
(lib.mkIf cfg.enable {
programs = {
# these are .zsh files, but the syntax is compatible
fish.interactiveShellInit = builtins.readFile
"${inputs.tokyonight}/extras/fzf/tokyonight_${cfg.style}.sh";
bash.initExtra = builtins.readFile
"${inputs.tokyonight}/extras/fzf/tokyonight_${cfg.style}.sh";
zsh.initExtra = builtins.readFile
"${inputs.tokyonight}/extras/fzf/tokyonight_${cfg.style}.sh";
fish.interactiveShellInit =
builtins.readFile "../../resources/fzf/tokyonight_${cfg.style}.sh";
bash.initExtra =
builtins.readFile "../../resources/fzf/tokyonight_${cfg.style}.sh";
zsh.initExtra =
builtins.readFile "../../resources/fzf/tokyonight_${cfg.style}.sh";
};
})
];
Expand Down
5 changes: 5 additions & 0 deletions resources/fzf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Why are the fzf themes vendored?

See [this issue](https://github.com/folke/tokyonight.nvim/issues/542).

tl;dr: the upstream themes take control away from the user for the `--layout` fzf option.
5 changes: 5 additions & 0 deletions resources/fzf/tokyonight_day.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \
--color=fg:#3760bf,bg:#e1e2e7,hl:#b15c00 \
--color=fg+:#3760bf,bg+:#c4c8da,hl+:#b15c00 \
--color=info:#2e7de9,prompt:#007197,pointer:#007197 \
--color=marker:#587539,spinner:#587539,header:#587539"
5 changes: 5 additions & 0 deletions resources/fzf/tokyonight_moon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \
--color=fg:#c8d3f5,bg:#222436,hl:#ff966c \
--color=fg+:#c8d3f5,bg+:#2f334d,hl+:#ff966c \
--color=info:#82aaff,prompt:#86e1fc,pointer:#86e1fc \
--color=marker:#c3e88d,spinner:#c3e88d,header:#c3e88d"
5 changes: 5 additions & 0 deletions resources/fzf/tokyonight_night.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \
--color=fg:#c0caf5,bg:#1a1b26,hl:#ff9e64 \
--color=fg+:#c0caf5,bg+:#292e42,hl+:#ff9e64 \
--color=info:#7aa2f7,prompt:#7dcfff,pointer:#7dcfff \
--color=marker:#9ece6a,spinner:#9ece6a,header:#9ece6a"
5 changes: 5 additions & 0 deletions resources/fzf/tokyonight_storm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \
--color=fg:#c0caf5,bg:#24283b,hl:#ff9e64 \
--color=fg+:#c0caf5,bg+:#292e42,hl+:#ff9e64 \
--color=info:#7aa2f7,prompt:#7dcfff,pointer:#7dcfff \
--color=marker:#9ece6a,spinner:#9ece6a,header:#9ece6a"

0 comments on commit 6476a8e

Please sign in to comment.