From f8832d1de8f67084e27e1963ae0f4de35382c09b Mon Sep 17 00:00:00 2001 From: Julius Riegel Date: Tue, 23 Apr 2024 09:39:14 +0200 Subject: [PATCH] Add nu utils and helix theme additions --- content/config/helix/themes/dracula-purple.toml | 2 ++ content/config/nushell/config.nu.tmpl | 1 + content/config/nushell/scripts/git.nu | 4 ++-- content/config/nushell/scripts/utils.nu | 8 ++++++++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 content/config/nushell/scripts/utils.nu diff --git a/content/config/helix/themes/dracula-purple.toml b/content/config/helix/themes/dracula-purple.toml index 9173ad5..443b1b0 100644 --- a/content/config/helix/themes/dracula-purple.toml +++ b/content/config/helix/themes/dracula-purple.toml @@ -20,6 +20,7 @@ "mustache_statement" = { fg = "green" } "string_literal" = { fg = "yellow" } "number_literal" = { fg = "purple" } +"label" = { fg = "red"} "diff.plus" = { fg = "green" } "diff.delta" = { fg = "orange" } @@ -44,6 +45,7 @@ "ui.virtual.ruler" = { bg = "ruler" } "ui.virtual.indent-guide" = { fg = "ruler" } "ui.virtual" = { fg = "hint" } +"ui.virtual.jump-label" = { fg = "red", modifiers = ["italic"] } "ui.statusline" = { fg = "foreground", bg = "background_dark" } "ui.statusline.inactive" = { fg = "comment", bg = "background_dark" } diff --git a/content/config/nushell/config.nu.tmpl b/content/config/nushell/config.nu.tmpl index bfd2091..69797f9 100644 --- a/content/config/nushell/config.nu.tmpl +++ b/content/config/nushell/config.nu.tmpl @@ -471,3 +471,4 @@ use ci.nu use ide.nu source remoting.nu +source utils.nu diff --git a/content/config/nushell/scripts/git.nu b/content/config/nushell/scripts/git.nu index 84b3a2c..0514bf6 100644 --- a/content/config/nushell/scripts/git.nu +++ b/content/config/nushell/scripts/git.nu @@ -204,7 +204,7 @@ export def gp [ --override --submodule (-s) # git submodule --init (-i) # git init - --merge (-m) # git pull (no)--rebase + --rebase (-r) # git pull (no)--rebase --autostash (-a) # git pull --autostash --back-to-prev (-b) # back to branch ] { @@ -216,7 +216,7 @@ export def gp [ git commit -v -a --no-edit --amend git push --force } else { - let m = if $merge { [] } else { [--rebase] } + let m = if $rebase { [--rebase] } else { [] } let a = if $autostash {[--autostash]} else {[]} let branch = if ($branch | is-empty) { (_git_status).branch } else { $branch } let branch_repr = $'(ansi yellow)($branch)(ansi light_gray)' diff --git a/content/config/nushell/scripts/utils.nu b/content/config/nushell/scripts/utils.nu new file mode 100644 index 0000000..62e7d02 --- /dev/null +++ b/content/config/nushell/scripts/utils.nu @@ -0,0 +1,8 @@ +# convert json log entries into an array of nu log entries +export def `from json-lines` [] { + lines | each {|it| try { $it | from json } catch { {msg: $it} }} +} + +export def `follow json-lines` [] { + lines | each {|it| try { $it | from json } catch { {msg: $it} } | table --expand | print} | ignore +}