Compare commits
No commits in common. "b88339dae609ab1272aab9882b5860d523ac57a0" and "4ac395388583e726f44d40ee6db7f9253a510906" have entirely different histories.
b88339dae6
...
4ac3953885
2 changed files with 42 additions and 23 deletions
9
stow/.config/fish/functions/0x0.fish
Normal file
9
stow/.config/fish/functions/0x0.fish
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
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
|
||||||
56
stow/.zshrc
56
stow/.zshrc
|
|
@ -1,14 +1,12 @@
|
||||||
# z shell configuration
|
# z shell configuration
|
||||||
|
|
||||||
#
|
OSICON="?"
|
||||||
# prompt
|
|
||||||
#
|
|
||||||
|
|
||||||
# set icon
|
# set prompt icon
|
||||||
if [ -e /System ]; then
|
if [ -e /System ]; then
|
||||||
OSICON=""
|
OSICON=""
|
||||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||||
elif [ -f /etc/os-release ]; then
|
else
|
||||||
. /etc/os-release &> /dev/null
|
. /etc/os-release &> /dev/null
|
||||||
|
|
||||||
if [ "$ID" = "nixos" ]; then
|
if [ "$ID" = "nixos" ]; then
|
||||||
|
|
@ -20,20 +18,21 @@ elif [ -f /etc/os-release ]; then
|
||||||
elif [ "$ID" = "arch" ]; then
|
elif [ "$ID" = "arch" ]; then
|
||||||
OSICON=""
|
OSICON=""
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
OSICON="$"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set prompt colours
|
# set prompt colours
|
||||||
|
HOSTNAME="$(hostname)"
|
||||||
|
|
||||||
if [ -f ~/.cache/zsh_colours.sh ]; then
|
if [ -f ~/.cache/zsh_colours.sh ]; then
|
||||||
source ~/.cache/zsh_colours.sh
|
source ~/.cache/zsh_colours.sh
|
||||||
else
|
else
|
||||||
PRIMARY_COLOUR="{blue}"
|
PRIMARY_COLOUR="{blue}"
|
||||||
SECONDARY_COLOUR="{yellow}"
|
SECONDARY_COLOUR="{red}"
|
||||||
TEXT_COLOUR="{black}"
|
TEXT_COLOUR="{black}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PROMPT="%F$PRIMARY_COLOUR%~ %F$SECONDARY_COLOUR$OSICON %k%F$TEXT_COLOUR"
|
PROMPT="%F$PRIMARY_COLOUR%~ %F$SECONDARY_COLOUR$OSICON %k%F$TEXT_COLOUR "
|
||||||
|
RPROMPT=""
|
||||||
|
|
||||||
bindkey -e
|
bindkey -e
|
||||||
|
|
||||||
|
|
@ -42,13 +41,13 @@ zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||||
zstyle ':completion:*' menu no
|
zstyle ':completion:*' menu no
|
||||||
|
|
||||||
#
|
# hist
|
||||||
# history
|
|
||||||
#
|
|
||||||
HISTFILE="$HOME/.local/share/zsh_hist"
|
HISTFILE="$HOME/.local/share/zsh_hist"
|
||||||
HISTSIZE=10000000
|
HISTSIZE=10000000
|
||||||
SAVEHIST=$HISTSIZE
|
SAVEHIST=$HISTSIZE
|
||||||
|
|
||||||
|
HOMEBREW_NO_AUTO_UPDATE=1
|
||||||
|
|
||||||
setopt appendhistory
|
setopt appendhistory
|
||||||
setopt sharehistory
|
setopt sharehistory
|
||||||
setopt hist_save_no_dups
|
setopt hist_save_no_dups
|
||||||
|
|
@ -56,19 +55,13 @@ setopt hist_ignore_all_dups
|
||||||
setopt hist_find_no_dups
|
setopt hist_find_no_dups
|
||||||
setopt hist_ignore_space
|
setopt hist_ignore_space
|
||||||
|
|
||||||
#
|
|
||||||
# shell alias
|
# shell alias
|
||||||
#
|
|
||||||
alias ls="ls -h --color=auto"
|
alias ls="ls -h --color=auto"
|
||||||
alias la="ls -ah --color=auto"
|
alias la="ls -ah --color=auto"
|
||||||
alias ll="ls -ahl --color=auto"
|
alias ll="ls -ahl --color=auto"
|
||||||
alias cat="bat"
|
alias cat="bat"
|
||||||
alias rm="trash"
|
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 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
|
alias tmux="tmux -f $HOME/.config/tmux/tmux.conf" # needed for osx systems for some reason
|
||||||
|
|
||||||
|
|
@ -78,18 +71,35 @@ export PATH="$PATH:$GOPATH/bin"
|
||||||
|
|
||||||
export EDITOR="nvim"
|
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
|
# plugins
|
||||||
#
|
|
||||||
plugindir="$HOME/.local/share/zsh_plug"
|
plugindir="$HOME/.local/share/zsh_plug"
|
||||||
func plugInstall() {
|
func plugInstall() {
|
||||||
# clones a repo and then sources it.
|
# clones a repo and then sources it.
|
||||||
# first arg is git url, second is source
|
# first arg is git url, second is source
|
||||||
# location
|
# location
|
||||||
|
|
||||||
if [ ! command -v "git" &> /dev/null ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
foldername=$(basename $1)
|
foldername=$(basename $1)
|
||||||
clonepath="$plugindir/$foldername"
|
clonepath="$plugindir/$foldername"
|
||||||
sourcefile="$clonepath/$2"
|
sourcefile="$clonepath/$2"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue