From c60b41200513b97a115229ec316122e9e19b654a Mon Sep 17 00:00:00 2001 From: "Agatha V. Lovelace" Date: Sun, 17 Dec 2023 21:08:04 +0100 Subject: [PATCH] Shell config refactor --- common/home_manager/common.nix | 36 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/common/home_manager/common.nix b/common/home_manager/common.nix index 91a77a9..eb2e9ce 100644 --- a/common/home_manager/common.nix +++ b/common/home_manager/common.nix @@ -10,14 +10,12 @@ bat btop choose - exa + eza fd fzf gnupg ouch ripgrep - tealdeer - zoxide ]; programs = { @@ -114,6 +112,14 @@ }; } ]; + shellAliases = { + ls = "eza -lFhT --group-directories-first --level 1"; + cat = "bat"; + ip = "ip -color=always"; + youtube-dl-audio = '' + yt-dlp --ignore-errors --output "%(title)s.%(ext)s" --extract-audio --audio-format best''; + rsync = "rsync -az --partial --info=progress2"; + }; functions = { expand-dot-to-parent-directory-path = '' # expand ... to ../.. etc @@ -154,12 +160,6 @@ fish_add_path -a (ruby -e 'print Gem.user_dir')/bin end - # Aliases - alias cat bat - alias ip 'ip -color=always' - alias youtube-dl-audio 'yt-dlp --ignore-errors --output "%(title)s.%(ext)s" --extract-audio --audio-format best' - alias rsync 'rsync -az --partial --info=progress2' - bind . 'expand-dot-to-parent-directory-path' if test -d ~/.gnupg @@ -170,15 +170,17 @@ gpg-connect-agent updatestartuptty /bye > /dev/null end ''; - interactiveShellInit = '' - if type -q exa - alias ls 'exa -lFhT --group-directories-first --level 1' - end + }; - if type -q zoxide - zoxide init --cmd v fish | source - end - ''; + tealdeer = { + enable = true; + settings = { updates.auto_update = true; }; + }; + + zoxide = { + enable = true; + enableFishIntegration = true; + options = [ "--cmd v" ]; }; command-not-found.enable = false;