mirror of
https://github.com/elwrcl/copnix.git
synced 2026-10-31 14:28:02 +03:00
nu
This commit is contained in:
10 files changed
+9
-9
No files matched your search
@@ -0,0 +1,38 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.homeModules.home-nushell-bash-compat =
|
||||
{ ... }:
|
||||
{
|
||||
programs.nushell.extraConfig = ''
|
||||
$env.DIRSTACK = []
|
||||
def --env pushd [path: path] {
|
||||
$env.DIRSTACK = ($env.DIRSTACK | prepend $env.PWD)
|
||||
cd $path
|
||||
}
|
||||
|
||||
def --env popd [] {
|
||||
if ($env.DIRSTACK | is-empty) {
|
||||
print $"(ansi red)popd: directory stack empty(ansi reset)"
|
||||
} else {
|
||||
let top = ($env.DIRSTACK | first)
|
||||
$env.DIRSTACK = ($env.DIRSTACK | skip 1)
|
||||
cd $top
|
||||
}
|
||||
}
|
||||
|
||||
def dirs [] {
|
||||
[$env.PWD] | append $env.DIRSTACK
|
||||
}
|
||||
|
||||
def bashc [command: string] {
|
||||
^bash -lc $command
|
||||
}
|
||||
|
||||
def rerun [] {
|
||||
let last = (history | last | get command)
|
||||
print $"(ansi grey)$ ($last)(ansi reset)"
|
||||
^bash -lc $last
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user