From 3d7a4ba0c2fb64109612ec7ea26298493ebc40d2 Mon Sep 17 00:00:00 2001 From: Nico Date: Sat, 1 Nov 2025 14:20:06 +1100 Subject: [PATCH 1/2] shell: remove 0x0 functions because broken --- stow/.config/fish/functions/0x0.fish | 9 --------- stow/.zshrc | 22 ---------------------- 2 files changed, 31 deletions(-) delete mode 100644 stow/.config/fish/functions/0x0.fish diff --git a/stow/.config/fish/functions/0x0.fish b/stow/.config/fish/functions/0x0.fish deleted file mode 100644 index c45280c..0000000 --- a/stow/.config/fish/functions/0x0.fish +++ /dev/null @@ -1,9 +0,0 @@ -function 0x0 --description 'Uploads a file or folder to 0x0.st' - if test -d "$argv" - set TMPFILE "$(mktemp --suffix '.tar')" - tar cvf "$TMPFILE" "$argv" - curl -F file="@$TMPFILE" -F expires=24 https://0x0.st - else - curl -F file=@"$argv" -F expires=24 https://0x0.st - end -end diff --git a/stow/.zshrc b/stow/.zshrc index cb24e72..21df395 100644 --- a/stow/.zshrc +++ b/stow/.zshrc @@ -71,28 +71,6 @@ export PATH="$PATH:$GOPATH/bin" export EDITOR="nvim" -# functions -func calc() { - # why isn't this in bash by default - # - if command -v python3 > /dev/null; then - python3 -c "print($1)" - else - echo "python3 needs to be installed for this to work!" - fi -} - -func 0x0() { - if [ -d "$1" ]; - then - TMPFILE="$(mktemp)" - tar cf "$TMPFILE" "$1" - curl -F file=@$TMPFILE -F expires=24 https://0x0.st - else - curl -F file=@$1 -F expires=24 https://0x0.st - fi -} - # plugins plugindir="$HOME/.local/share/zsh_plug" func plugInstall() { From b88339dae609ab1272aab9882b5860d523ac57a0 Mon Sep 17 00:00:00 2001 From: Nico Date: Sat, 1 Nov 2025 14:58:55 +1100 Subject: [PATCH 2/2] zsh: clean up zshrc --- stow/.zshrc | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/stow/.zshrc b/stow/.zshrc index 21df395..d0e1a53 100644 --- a/stow/.zshrc +++ b/stow/.zshrc @@ -1,12 +1,14 @@ # z shell configuration -OSICON="?" +# +# prompt +# -# set prompt icon +# set icon if [ -e /System ]; then OSICON="" eval "$(/opt/homebrew/bin/brew shellenv)" -else +elif [ -f /etc/os-release ]; then . /etc/os-release &> /dev/null if [ "$ID" = "nixos" ]; then @@ -18,21 +20,20 @@ else elif [ "$ID" = "arch" ]; then OSICON="" fi +else + OSICON="$" fi # set prompt colours -HOSTNAME="$(hostname)" - if [ -f ~/.cache/zsh_colours.sh ]; then source ~/.cache/zsh_colours.sh else PRIMARY_COLOUR="{blue}" - SECONDARY_COLOUR="{red}" + SECONDARY_COLOUR="{yellow}" TEXT_COLOUR="{black}" fi -PROMPT="%F$PRIMARY_COLOUR%~ %F$SECONDARY_COLOUR$OSICON %k%F$TEXT_COLOUR " -RPROMPT="" +PROMPT="%F$PRIMARY_COLOUR%~ %F$SECONDARY_COLOUR$OSICON %k%F$TEXT_COLOUR" bindkey -e @@ -41,13 +42,13 @@ zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" zstyle ':completion:*' menu no -# hist +# +# history +# HISTFILE="$HOME/.local/share/zsh_hist" HISTSIZE=10000000 SAVEHIST=$HISTSIZE -HOMEBREW_NO_AUTO_UPDATE=1 - setopt appendhistory setopt sharehistory setopt hist_save_no_dups @@ -55,13 +56,19 @@ setopt hist_ignore_all_dups setopt hist_find_no_dups setopt hist_ignore_space +# # shell alias +# alias ls="ls -h --color=auto" alias la="ls -ah --color=auto" alias ll="ls -ahl --color=auto" alias cat="bat" alias rm="trash" +alias v="nvim" +alias vi="nvim" +alias vim="nvim" + alias ssh="TERM=xterm-256color ssh" # fix ssh not recognising terminal and remote shell being somewhat broken alias tmux="tmux -f $HOME/.config/tmux/tmux.conf" # needed for osx systems for some reason @@ -72,12 +79,17 @@ export PATH="$PATH:$GOPATH/bin" export EDITOR="nvim" # plugins +# plugindir="$HOME/.local/share/zsh_plug" func plugInstall() { # clones a repo and then sources it. # first arg is git url, second is source # location + if [ ! command -v "git" &> /dev/null ]; then + exit 1 + fi + foldername=$(basename $1) clonepath="$plugindir/$foldername" sourcefile="$clonepath/$2"