42 lines
972 B
Nix
Raw Normal View History

2022-05-06 09:29:25 -04:00
{ config, ... }: {
home-manager.users.${config.user} = {
programs.fzf.enable = true;
programs.fish = {
functions = {
projects = {
description = "Jump to a project";
body = ''
2022-06-20 15:20:20 -04:00
set projdir ( \
fd \
2022-06-21 17:51:27 -04:00
--search-path $HOME/dev \
2022-06-20 15:20:20 -04:00
--type directory \
--hidden \
"^.git\$" \
2022-06-20 15:49:25 -04:00
| xargs dirname \
2022-06-26 21:53:08 -04:00
| fzf \
--delimiter '/' \
--with-nth 6.. \
)
2022-06-20 15:49:25 -04:00
and cd $projdir
2022-05-06 09:29:25 -04:00
and commandline -f execute
'';
};
};
2022-06-26 22:08:17 -04:00
shellAbbrs = { lsf = "ls -lh | fzf"; };
2022-05-06 09:29:25 -04:00
};
2022-05-29 13:44:45 -04:00
# Global fzf configuration
2022-05-06 09:29:25 -04:00
home.sessionVariables = let fzfCommand = "fd --type file";
in {
FZF_DEFAULT_COMMAND = fzfCommand;
FZF_CTRL_T_COMMAND = fzfCommand;
FZF_DEFAULT_OPTS = "-m --height 50% --border";
};
};
}