fish: fix last-working-dir function
This commit is contained in:
@ -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";
|
||||
# };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user