From 449d3c50efccbb806eea313fac45d2fb25d6b7ca Mon Sep 17 00:00:00 2001 From: eltrac Date: Sat, 7 Nov 2026 20:33:42 +0800 Subject: nushell: add pon (proxy on) and poff (proxy off) commands --- nushell/config.nu | 23 +++++++++++++++++++++++ nushell/env.nu | 6 ------ 2 files changed, 23 insertions(+), 6 deletions(-) (limited to 'nushell') diff --git a/nushell/config.nu b/nushell/config.nu index 8bdf6c7..b1b96af 100644 --- a/nushell/config.nu +++ b/nushell/config.nu @@ -23,6 +23,25 @@ alias nuconf = config nu alias nuenv = config env alias ssh = ghostty +ssh +# --- Network proxy ---- + +$env.no_proxy = 'localhost,127.0.0.1' + +def pon [] { + $env.http_proxy = 'http://127.0.0.1:7890' + $env.https_proxy = 'http://127.0.0.1:7890' + $env.all_proxy = 'socks5://127.0.0.1:7890' +} + +def poff [] { + $env.http_proxy = '' + $env.https_proxy = '' + $env.all_proxy = '' +} + +## default on +pon + # ---- Custom commands ---- # Remind to use mosh instead of ssh @@ -65,6 +84,10 @@ def gitvis [] { git log --oneline --graph --all --decorate } +def git-reauthor [] { + git commit --amend --reset-author --no-edit +} + # check what apps are not managed by homebrew def brewoutcasts [] { let apps = (ls /Applications | where type == dir and name ends-with '.app') diff --git a/nushell/env.nu b/nushell/env.nu index e2f0f1d..c40ec2e 100644 --- a/nushell/env.nu +++ b/nushell/env.nu @@ -51,12 +51,6 @@ $env.EDITOR = 'nvim' $env.HOMEBREW_NO_ENV_HINTS = '1' $env.PUPPETEER_EXECUTABLE_PATH = ($env.HOME | path join '.cache/puppeteer/chrome/mac_arm-142.0.7444.59/chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing') -# Proxy -$env.http_proxy = 'http://127.0.0.1:7890' -$env.https_proxy = 'http://127.0.0.1:7890' -$env.all_proxy = 'socks5://127.0.0.1:7890' -$env.no_proxy = 'localhost,127.0.0.1' - # GPG try { $env.GPG_TTY = (tty | str trim) } catch { } -- cgit v1.2.3