Skip to content

Commit

Permalink
add eza
Browse files Browse the repository at this point in the history
  • Loading branch information
allthatjazzleo committed Apr 24, 2024
1 parent 74a5105 commit b6665d2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cells/homemanager/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ in {
allowUnsupportedSystem = true;
}
'';

file.".config/fzf-git.sh".text = builtins.readFile (builtins.fetchurl {
url = "https://raw.githubusercontent.com/junegunn/fzf-git.sh/master/fzf-git.sh";
sha256 = "10h7lhf99jdmzwxl0v0qvild0cr0cx5kv8kanni8w1v1vbh47pjd";
});
};

programs = cell.programs.default homeDirectory user;
Expand Down
2 changes: 2 additions & 0 deletions cells/homemanager/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ in {
[
ansible
awscli2
bat
cachix
delve
direnv
dive
envsubst
fd
gh
git-open
gnupg
Expand Down
40 changes: 39 additions & 1 deletion cells/homemanager/programs/zsh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@
# krew
export PATH="$HOME/.krew/bin:$PATH"
# End krew
# fzf.
_fzf_comprun() {
local command=$1
shift
case "$command" in
cd) fzf --preview 'eza --tree --color=always {} | head -200' "$@" ;;
export|unset) fzf --preview "eval 'echo \$'{}" "$@" ;;
ssh) fzf --preview 'dig {}' "$@" ;;
*) fzf --preview 'bat -n --color=always {} --line-range :500 {}' "$@" ;;
esac
}
source ~/.config/fzf-git.sh
# End fzf
'';
initExtra =
''
Expand Down Expand Up @@ -88,10 +101,35 @@
else ""
);
};

eza = {
enable = true;
};
bat = {
enable = true;
config = {
theme = "Dracula";
};
themes = {
dracula = {
src = inputs.nixpkgs.fetchFromGitHub {
owner = "dracula";
repo = "sublime"; # Bat uses sublime syntax for its themes
rev = "26c57ec282abcaa76e57e055f38432bd827ac34e";
sha256 = "019hfl4zbn4vm4154hh3bwk6hm7bdxbr1hdww83nabxwjn99ndhv";
};
file = "Dracula.tmTheme";
};
};
};
fzf = {
enable = true;
enableZshIntegration = true;
defaultCommand = "fd --type file --follow --hidden --color=always --exclude .git";
defaultOptions = ["--ansi" "--bind ctrl-j:preview-up,ctrl-k:preview-down,ctrl-u:preview-half-page-up,ctrl-p:preview-half-page-down"];
fileWidgetCommand = "fd --type file --follow --hidden --color=always --exclude .git";
fileWidgetOptions = ["--ansi" "--preview-window 'right:57%'" "--preview 'bat -n --color=always --line-range :500 {}'"];
changeDirWidgetCommand = "fd --type=d --follow --hidden --color=always --exclude .git";
changeDirWidgetOptions = ["--ansi" "--preview 'eza --tree --color=always {} | head -200'"];
};
nix-index = {
enable = true;
Expand Down

0 comments on commit b6665d2

Please sign in to comment.