From f33c9ae16134d454b984669758cb293cb04cc1cf Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Fri, 16 Feb 2024 08:21:20 +0100 Subject: [PATCH] fix custom commands and add `ed` command --- other/config.nu | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/other/config.nu b/other/config.nu index cda795c..c590b75 100644 --- a/other/config.nu +++ b/other/config.nu @@ -782,9 +782,9 @@ def start_zellij [] { start_zellij def nsp [ - program: string + ...programs: string ] { - nix shell $"nixpkgs#$program" + nix shell ...($programs | each {|it| $"nixpkgs#($it)" }) } def lcr [ @@ -806,6 +806,17 @@ def glog [ | split column "»¦«" commit subject name email date } +def ed [ + file: path + ...cmdargs: string +] { + let ext = $file | path parse | get extension; + match $ext { + "typ" => {|| zellij run --direction down -- typst watch $file --open ($cmdargs | str join ' ') } + }; + hx $file +} + alias gnix = cd ~/nix-configs; alias grepo = cd ~/Documents/repos; alias wh = wormhole-rs;