2020-01-16 17:01:59 -06:00
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
2020-12-17 10:12:21 -06:00
|
|
|
alias ls 'exa --group-directories-first'
|
|
|
|
alias tree 'ls --tree --level=3'
|
|
|
|
alias lA 'ls -a'
|
|
|
|
alias ll 'ls -l'
|
|
|
|
alias la 'll -a'
|
2021-01-06 10:53:07 -06:00
|
|
|
alias lt 'll -s modified'
|
2020-12-17 10:12:21 -06:00
|
|
|
alias lT 'lt -r'
|
2021-01-06 10:53:07 -06:00
|
|
|
alias lc 'lt -s accessed'
|
2020-12-17 10:12:21 -06:00
|
|
|
alias lC 'lc -r'
|
|
|
|
|
2020-12-17 11:27:27 -06:00
|
|
|
set -gx CDPATH $CDPATH . $NICE_HOME
|
|
|
|
|
2020-12-17 10:12:21 -06:00
|
|
|
function d -w cd --description "Quickly jump to NICE_HOME (or given relative or absolute path) and list files."
|
2020-01-23 09:51:03 -06:00
|
|
|
if scount $argv
|
|
|
|
cd $argv || exit 1
|
2020-01-16 17:01:59 -06:00
|
|
|
else
|
|
|
|
cd $NICE_HOME || exit 1
|
|
|
|
end
|
2020-01-23 09:51:03 -06:00
|
|
|
la
|
2020-01-16 17:01:59 -06:00
|
|
|
end
|
2020-01-23 09:51:03 -06:00
|
|
|
|
2020-12-17 11:27:27 -06:00
|
|
|
function c -w cd --description "Quickly jump to a subdirectory of NICE_HOME (or just to NICE_HOME if none given)"
|
2020-01-23 09:51:03 -06:00
|
|
|
if scount $argv
|
|
|
|
cd $NICE_HOME && d $argv || exit 1
|
|
|
|
else
|
|
|
|
d $NICE_HOME
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
alias cd.. "d .."
|
2020-12-17 10:12:21 -06:00
|
|
|
alias cdd "d $DOTFILES_PATH"
|
2021-03-06 22:07:30 -06:00
|
|
|
alias cde "d $XDG_CONFIG_HOME/lytedev-env"
|
2020-12-17 10:12:21 -06:00
|
|
|
alias cdc "d $XDG_CONFIG_HOME"
|
2020-01-23 09:51:03 -06:00
|
|
|
alias cdn "d $NOTES_PATH"
|
2020-11-05 21:13:39 -06:00
|
|
|
alias cdl "d $XDG_DOWNLOAD_DIR"
|
|
|
|
alias cdg "d $XDG_GAMES_DIR"
|
2020-01-23 09:51:03 -06:00
|
|
|
alias .. "d .."
|
|
|
|
alias ... "d ../.."
|
|
|
|
alias .... "d ../../.."
|
|
|
|
alias ..... "d ../../../.."
|
|
|
|
alias ...... "d ../../../../.."
|
|
|
|
alias ....... "d ../../../../../.."
|
|
|
|
alias ........ "d ../../../../../../.."
|
|
|
|
alias ......... "d ../../../../../../../.."
|
2020-01-16 17:01:59 -06:00
|
|
|
|
2020-12-17 10:12:21 -06:00
|
|
|
function r --wraps nnn --description 'Run nnn with support for jump-to-directory-on-exit via ^G'
|
|
|
|
# TODO: this would break with multiple nnn instances, right?
|
|
|
|
# probably need to mktemp instead
|
|
|
|
set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
|
|
|
|
nnn -P p $argv
|
|
|
|
test -e $NNN_TMPFILE && source $NNN_TMPFILE && rm $NNN_TMPFILE
|
|
|
|
end
|
|
|
|
alias l r
|
|
|
|
|
|
|
|
alias t "tmux"
|
|
|
|
alias rcp 'rsync -r -ah --progress'
|
|
|
|
alias cat bat
|
|
|
|
|
2020-11-17 17:17:03 -06:00
|
|
|
function g -w git
|
2020-12-17 10:12:21 -06:00
|
|
|
if scount $argv; git $argv
|
|
|
|
else; git status; end
|
2020-01-16 17:01:59 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
alias dlf "docker logs --tail=500 -f"
|
|
|
|
alias dclf "docker-compose logs --tail=500 -f"
|
|
|
|
alias ctop "docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock quay.io/vektorlab/ctop:latest"
|
|
|
|
|
2020-12-17 10:12:21 -06:00
|
|
|
function chat
|
|
|
|
set -l pass (pass config/weechat-passphrase | head -n 1)
|
|
|
|
env WEECHAT_PASSPHRASE=$pass weechat
|
2020-03-06 15:43:01 -06:00
|
|
|
end
|
2020-12-17 10:12:21 -06:00
|
|
|
|
|
|
|
function rgl; rg --color always $argv | less -r; end
|
|
|
|
|
|
|
|
alias k "kubectl"
|
|
|
|
alias kg "k get"
|
|
|
|
|
|
|
|
alias rg "rg --text"
|
|
|
|
alias grep "rg"
|
|
|
|
alias gr "rg"
|
|
|
|
|
|
|
|
alias vim "$EDITOR"
|
|
|
|
alias vi "$EDITOR"
|
|
|
|
alias v "$EDITOR"
|
|
|
|
alias e "$EDITOR"
|
|
|
|
alias se "sudo -E $EDITOR"
|
|
|
|
alias svim "se"
|
|
|
|
|
|
|
|
alias vltl "$EDITOR (ltl)"
|
|
|
|
alias cdltl "cd (ltld)"
|
|
|
|
|
|
|
|
function pp; while not ping -n 1 -t 5 8.8.8.8; sleep 1; end; end
|
2020-01-16 17:01:59 -06:00
|
|
|
alias p "ping 8.8.8.8"
|
2020-12-23 10:44:19 -06:00
|
|
|
alias C "clear; set -q TMUX && tmux clear-history || true"
|
2020-01-16 17:01:59 -06:00
|
|
|
alias sctl "sudo systemctl"
|
|
|
|
alias sctlu "systemctl --user"
|
2020-11-21 23:13:58 -06:00
|
|
|
alias bt "sctl start bluetooth && sudo bluetoothctl"
|
2020-01-16 17:01:59 -06:00
|
|
|
alias btctl "bt"
|
2020-01-20 10:49:06 -06:00
|
|
|
alias resrc "source $XDG_CONFIG_HOME/fish/config.fish"
|
2020-01-16 17:01:59 -06:00
|
|
|
alias sc "sc-im"
|
|
|
|
alias scs "sc-im $NOTES_PATH/_scratch.sc"
|
|
|
|
alias disks "lsblk && df -h"
|
|
|
|
alias dd "dd status=progress"
|
2020-12-17 10:12:21 -06:00
|
|
|
alias wifi "sudo iwctl"
|
2020-01-16 17:01:59 -06:00
|
|
|
alias year 'cal (date +%Y)'
|
2020-11-06 11:37:55 -06:00
|
|
|
alias mount 'sudo -E mount'
|
2020-01-20 14:01:06 -06:00
|
|
|
alias pa pulsemixer
|
2020-12-17 11:27:27 -06:00
|
|
|
alias mail neomutt
|
2021-03-04 10:26:47 -06:00
|
|
|
alias wje work-journal-entry
|