From 38232c81ab8d513e306c8910eec4545329a8827c Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Wed, 15 Mar 2023 13:37:20 +0700 Subject: [PATCH] Fish improvements: path, rustup, wget, sql functions, and clean up --- .config/fish/config.fish | 10 ---------- .config/fish/fish_variables | 4 +++- .../functions/{listpaths.fish => fish_listpaths.fish} | 2 +- .config/fish/functions/rustup.fish | 3 +++ .config/fish/functions/sql.fish | 2 +- .config/fish/functions/wget.fish | 3 +++ 6 files changed, 11 insertions(+), 13 deletions(-) rename .config/fish/functions/{listpaths.fish => fish_listpaths.fish} (66%) create mode 100644 .config/fish/functions/rustup.fish create mode 100644 .config/fish/functions/wget.fish diff --git a/.config/fish/config.fish b/.config/fish/config.fish index a800bc8..82ec397 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -15,11 +15,6 @@ set -gx DOTNET_CLI_TELEMETRY_OPTOUT 1 bind \cx 'if test -z (commandline) ; fg %1 &>/dev/null; else ; clear; commandline "╰─>$ "; end' -if [ (uname -r | sed -n 's/.*\( *Microsoft *\).*/\1/ip') ] - set -gx DISPLAY 127.0.0.1:0.0 - alias xdg-open wsl-open -end - abbr -a -g gs "git status --untracked-files" abbr -a -g gl "git lop -10" abbr -a -g gll "git lol -15" @@ -78,8 +73,3 @@ function fish_prompt --description 'Write out the prompt; do not replace this. I printf "%b" (string join " \n" (vterm_old_fish_prompt)) vterm_prompt_end end - -set -q GHCUP_INSTALL_BASE_PREFIX[1]; or set GHCUP_INSTALL_BASE_PREFIX $HOME ; set -gx PATH $HOME/.cabal/bin $PATH /home/joe/.ghcup/bin # ghcup-env - -# opam configuration -source /home/joe/.local/share/opam/opam-init/init.fish > /dev/null 2> /dev/null; or true diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index d1e543f..bbd4c0b 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables @@ -3,6 +3,8 @@ SETUVAR --export CARGO_HOME:/home/joe/\x2elocal/share/bin/cargo/ SETUVAR EDITOR:hx SETUVAR --export LC_COLLATE:C +SETUVAR --export PYTHONSTARTUP:/etc/python/pythonrc +SETUVAR --export RUSTUP_HOME:/home/joe/\x2elocal/share/rustup/ SETUVAR XDG_CACHE_HOME:/home/joe/\x2ecache SETUVAR XDG_CONFIG_HOME:/home/joe/\x2econfig SETUVAR XDG_DATA_HOME:/home/joe/\x2elocal/share @@ -36,4 +38,4 @@ SETUVAR fish_pager_color_description:B3A06D\x1eyellow SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan SETUVAR fish_pager_color_selected_background:\x2dr -SETUVAR fish_user_paths:/home/joe/\x2elocal/share/bin/cargo/bin\x1e/home/joe/\x2elocal/share/solana/install/active_release/bin\x1e/home/joe/\x2elocal/bin +SETUVAR fish_user_paths:/home/joe/\x2elocal/share/bin/cargo/bin\x1e\x1e/home/joe/\x2elocal/bin diff --git a/.config/fish/functions/listpaths.fish b/.config/fish/functions/fish_listpaths.fish similarity index 66% rename from .config/fish/functions/listpaths.fish rename to .config/fish/functions/fish_listpaths.fish index af53050..325f13f 100644 --- a/.config/fish/functions/listpaths.fish +++ b/.config/fish/functions/fish_listpaths.fish @@ -1,4 +1,4 @@ -function listpaths +function fish_listpaths for p in $PATH echo $p end diff --git a/.config/fish/functions/rustup.fish b/.config/fish/functions/rustup.fish new file mode 100644 index 0000000..2f2a000 --- /dev/null +++ b/.config/fish/functions/rustup.fish @@ -0,0 +1,3 @@ +function rustup --wraps='RUSTUP_HOME=/home/joe/.local/share/rustup/ /home/joe/.local/share/bin/cargo/bin/rustup' --description 'alias rustup RUSTUP_HOME=/home/joe/.local/share/rustup/ /home/joe/.local/share/bin/cargo/bin/rustup' + RUSTUP_HOME=/home/joe/.local/share/rustup/ /home/joe/.local/share/bin/cargo/bin/rustup $argv +end diff --git a/.config/fish/functions/sql.fish b/.config/fish/functions/sql.fish index aca4125..81be8e2 100644 --- a/.config/fish/functions/sql.fish +++ b/.config/fish/functions/sql.fish @@ -1,3 +1,3 @@ function sql - SQLITE_HISTORY="$XDG_CACHE_HOME"/sqlite_history sqlite3 -init "$XDG_CONFIG_HOME"/sqlite3/sqliterc + SQLITE_HISTORY="$XDG_CACHE_HOME"/sqlite_history sqlite3 -init "$XDG_CONFIG_HOME"/sqlite3/sqliterc "$argv" end diff --git a/.config/fish/functions/wget.fish b/.config/fish/functions/wget.fish new file mode 100644 index 0000000..b37d516 --- /dev/null +++ b/.config/fish/functions/wget.fish @@ -0,0 +1,3 @@ +function wget --description 'alias wget wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"' + command wget --hsts-file="$XDG_CACHE_HOME/wget-hsts" $argv +end