extract fzf config
This commit is contained in:
parent
1508d388c7
commit
4976b7e1ab
|
@ -7,7 +7,6 @@ in {
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
set -g __accent_color "${accent.color}"
|
set -g __accent_color "${accent.color}"
|
||||||
alias _fish_prompt_accent "_fish_prompt_color '$__accent_color'"
|
alias _fish_prompt_accent "_fish_prompt_color '$__accent_color'"
|
||||||
fzf_key_bindings
|
|
||||||
set_color red
|
set_color red
|
||||||
if not test -d "$HOME/.password-store/"
|
if not test -d "$HOME/.password-store/"
|
||||||
echo "Password Store not yet setup"
|
echo "Password Store not yet setup"
|
||||||
|
@ -52,7 +51,6 @@ in {
|
||||||
};
|
};
|
||||||
programs.zoxide.enable = true;
|
programs.zoxide.enable = true;
|
||||||
programs.direnv.enable = true;
|
programs.direnv.enable = true;
|
||||||
programs.fzf.enable = true;
|
|
||||||
home.file = {
|
home.file = {
|
||||||
".config/fish/conf.d/prompt.fish".source = ./fish_prompt.fish;
|
".config/fish/conf.d/prompt.fish".source = ./fish_prompt.fish;
|
||||||
};
|
};
|
||||||
|
|
34
user/fzf.nix
Normal file
34
user/fzf.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{ config, pkgs, lib, inputs, ... }:
|
||||||
|
let inherit (import ./variables.nix) key theme color accent font;
|
||||||
|
|
||||||
|
colors = {
|
||||||
|
"bg+" = color.bg_light;
|
||||||
|
"hl+" = color.normal.green;
|
||||||
|
gutter = color.bg;
|
||||||
|
prompt = accent.color;
|
||||||
|
pointer = accent.color;
|
||||||
|
spinner = accent.color;
|
||||||
|
};
|
||||||
|
makeKeyValue = (k: v: "${k}:${v}");
|
||||||
|
makeOptList = lib.mapAttrsToList makeKeyValue colors;
|
||||||
|
makeColorValue = lib.strings.concatStringsSep "," makeOptList;
|
||||||
|
color_opts = "--color=${makeColorValue}";
|
||||||
|
preview_opts =
|
||||||
|
"--preview '${pkgs.bat}/bin/bat --style=numbers --color=always {}'";
|
||||||
|
|
||||||
|
in {
|
||||||
|
programs.fzf = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
fileWidgetCommand = "${pkgs.fd}/bin/fd --type f";
|
||||||
|
fileWidgetOptions = [ "--preview '${pkgs.bat}/bin/bat --style=numbers --color=always {}'" ];
|
||||||
|
|
||||||
|
changeDirWidgetCommand = "${pkgs.fd}/bin/fd --type d";
|
||||||
|
changeDirWidgetOptions = [ "--preview '${pkgs.exa}/bin/exa -T L3 | head -200'" ];
|
||||||
|
|
||||||
|
defaultOptions = [
|
||||||
|
color_opts
|
||||||
|
preview_opts
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -22,6 +22,7 @@ in {
|
||||||
./chat.nix
|
./chat.nix
|
||||||
./syncthing.nix
|
./syncthing.nix
|
||||||
./bmenu.nix
|
./bmenu.nix
|
||||||
|
./fzf.nix
|
||||||
inputs.hyprland.homeManagerModules.default
|
inputs.hyprland.homeManagerModules.default
|
||||||
];
|
];
|
||||||
# Home Manager needs a bit of information about you and the
|
# Home Manager needs a bit of information about you and the
|
||||||
|
@ -125,22 +126,6 @@ in {
|
||||||
QT_QPA_PLATFORMTHEME = "gtk3";
|
QT_QPA_PLATFORMTHEME = "gtk3";
|
||||||
VOLUME_CHANGE_SOUND =
|
VOLUME_CHANGE_SOUND =
|
||||||
"${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/audio-volume-change.oga";
|
"${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/audio-volume-change.oga";
|
||||||
FZF_DEFAULT_OPTS = let
|
|
||||||
colors = {
|
|
||||||
"bg+" = color.bg_light;
|
|
||||||
"hl+" = color.normal.green;
|
|
||||||
gutter = color.bg;
|
|
||||||
prompt = accent.color;
|
|
||||||
pointer = accent.color;
|
|
||||||
spinner = accent.color;
|
|
||||||
};
|
|
||||||
makeKeyValue = (k: v: "${k}:${v}");
|
|
||||||
makeOptList = lib.mapAttrsToList makeKeyValue colors;
|
|
||||||
makeColorValue = lib.strings.concatStringsSep "," makeOptList;
|
|
||||||
color_opts = "--color=${makeColorValue}";
|
|
||||||
preview_opts =
|
|
||||||
"--preview '${pkgs.bat}/bin/bat --style=numbers --color=always {}'";
|
|
||||||
in "${preview_opts} ${color_opts}";
|
|
||||||
};
|
};
|
||||||
programs.bash = { enable = true; };
|
programs.bash = { enable = true; };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue