diff --git a/install.nu b/install.nu index 94b5c8e..ec18ea5 100644 --- a/install.nu +++ b/install.nu @@ -4,5 +4,7 @@ if (($dotfiles_symlink_path | path exists) != true) { if ((sys).host.name == "Windows") { ^mklink /d $"($dotfiles_symlink_path)" $"($env.PWD)" } else { ^ln -s $env.PWD $dotfiles_symlink_path } } +config reset + echo $"\n# Load config.nu\nsource ~\\.config\\dotfiles\\nushell\\config.nu" | save --raw --append $"($nu.config-path)" echo $"\n# Load env.nu\nsource ~\\.config\\dotfiles\\nushell\\env.nu" | save --raw --append $"($nu.env-path)" diff --git a/nushell/commands.nu b/nushell/commands.nu index 64f08a7..da572e2 100644 --- a/nushell/commands.nu +++ b/nushell/commands.nu @@ -13,3 +13,8 @@ def "dadjoke" [] { def bup [] { brew update; brew upgrade; brew cleanup } + +def "git gone" [] { + # gently try to delete merged branches, excluding the checked out one + git branch --merged | lines | where $it !~ '\*' | str trim | where $it != 'master' and $it != 'main' | each { |it| git branch -d $it } +} diff --git a/nushell/env.nu b/nushell/env.nu index cf69785..a29de79 100644 --- a/nushell/env.nu +++ b/nushell/env.nu @@ -1,3 +1,5 @@ +$env.EDITOR = 'code' + # Starship mkdir ~/.cache/starship starship init nu | save ~/.cache/starship/init.nu -f