diff --git a/modules/home/fish/default.nix b/modules/home/fish/default.nix index 78dafa0..36201c0 100644 --- a/modules/home/fish/default.nix +++ b/modules/home/fish/default.nix @@ -26,7 +26,11 @@ in { config = mkIf cfg.enable { - home.file = { ".config/starship.toml".source = ./starship.toml; }; + home.file = { + ".config/starship.toml".source = ./starship.toml; + ".config/fish/conf.d/last-working-dir.fish".source = + ./last-working-dir.fish; + }; home.packages = with pkgs; [ starship ]; @@ -40,16 +44,10 @@ in { interactiveShellInit = "set fish_greeting"; # Disable default greeting - plugins = [ - { - name = "z"; - src = pkgs.fishPlugins.z.src; - } - { - name = "lwd"; - src = ./last-working-dir.fish; - } - ]; + plugins = [{ + name = "z"; + src = pkgs.fishPlugins.z.src; + }]; functions = { fzf-z = '' @@ -63,12 +61,6 @@ in { run = '' nix run nixpkgs#"$argv[1]" -- $argv[2..-1] ''; - - # Last working directory functionality - # __onpwd = { - # onVariable = "PWD"; - # body = "set --universal LAST_WORKING_DIR $PWD"; - # }; }; }; }; diff --git a/modules/home/fish/last-working-dir.fish b/modules/home/fish/last-working-dir.fish index 3d66d0f..d2f0555 100644 --- a/modules/home/fish/last-working-dir.fish +++ b/modules/home/fish/last-working-dir.fish @@ -1,7 +1,3 @@ -if status --is-interactive; and test -d $LAST_WORKING_DIR; and test $PWD = $HOME - cd $LAST_WORKING_DIR -end - function lwd cd $LAST_WORKING_DIR end @@ -9,4 +5,3 @@ end function __onpwd --on-variable PWD set --universal LAST_WORKING_DIR $PWD end -# __onpwd