2020-01-16 17:01:59 -06:00
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
2020-11-17 17:17:03 -06:00
|
|
|
# TODO: exa?
|
2020-01-16 17:01:59 -06:00
|
|
|
alias lk 'ls -lSr' # order by filesize reversed
|
|
|
|
alias lt 'ls -ltr' # order by file modified time
|
|
|
|
alias lc 'ls -ltcr' # order by filectime
|
|
|
|
alias lu 'ls -ltur' # order by file access time
|
|
|
|
alias ls 'ls -h --color --group-directories-first' # flat view w/ directories first
|
|
|
|
alias l 'ls -h --color --group-directories-first' # same as above
|
|
|
|
alias ll 'ls -lv --group-directories-first' # non-flat view
|
|
|
|
alias la 'll -A' # show all
|
|
|
|
|
2020-11-17 17:17:03 -06:00
|
|
|
# TODO: cat > bat
|
2020-01-16 17:01:59 -06:00
|
|
|
alias tree 'tree -Csuh'
|
|
|
|
alias f fzf
|
2020-11-20 21:40:10 -06:00
|
|
|
alias r 'nnn -P p'
|
2020-11-17 17:17:03 -06:00
|
|
|
alias t "tmux"
|
2020-11-06 11:16:29 -06:00
|
|
|
alias rcp 'rsync -r -ah --progress'
|
2020-01-16 17:01:59 -06:00
|
|
|
|
2020-11-05 21:13:39 -06:00
|
|
|
alias vltl "$EDITOR (ltl)"
|
2020-01-16 17:01:59 -06:00
|
|
|
alias cdltl "cd (ltld)"
|
|
|
|
|
2020-11-05 21:13:39 -06:00
|
|
|
function d -w cd --description "Quickly jump to NICE_HOME (or given dir) and show 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
|
|
|
|
|
|
|
# navigation aliases
|
2020-11-06 11:50:32 -06:00
|
|
|
function c --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
|
2020-11-06 11:50:32 -06:00
|
|
|
complete --erase --command c
|
2020-11-20 21:40:10 -06:00
|
|
|
complete --command c -a \
|
|
|
|
"(pushd $NICE_HOME && fd . . --max-depth 1 --min-depth 1 -x ls -p && popd)"
|
2020-01-23 09:51:03 -06:00
|
|
|
|
|
|
|
alias cd.. "d .."
|
|
|
|
alias cdd "d $DOTFILES_PATH" # go to dotfiles
|
|
|
|
alias cde "d $ENV_PATH" # go to env dotfiles
|
|
|
|
alias cdc "d $XDG_CONFIG_HOME" # go to ~/.config
|
|
|
|
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-10-26 23:43:18 -05:00
|
|
|
alias cdnx "d $DOTFILES_PATH/env/nix"
|
2020-01-16 17:01:59 -06:00
|
|
|
|
|
|
|
# quick parent-directory aliases
|
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-11-17 17:17:03 -06:00
|
|
|
function g -w git
|
2020-01-23 09:51:03 -06:00
|
|
|
if scount $argv
|
2020-01-16 17:01:59 -06:00
|
|
|
git $argv
|
|
|
|
else
|
|
|
|
git status
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# docker aliases
|
|
|
|
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"
|
|
|
|
|
|
|
|
# misc aliases
|
2020-03-06 15:43:01 -06:00
|
|
|
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-11-17 17:17:03 -06:00
|
|
|
alias C "clear && clear" # TODO: this should clear a tmux pane's scrollback/logs
|
2020-11-20 21:40:10 -06:00
|
|
|
alias l "nnn"
|
2020-01-16 17:01:59 -06:00
|
|
|
alias sctl "sudo systemctl"
|
|
|
|
alias sctlu "systemctl --user"
|
2020-11-17 17:17:03 -06:00
|
|
|
alias bt "sudo bluetoothctl" # TODO: a vi-like tui for bluetooth would be great
|
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"
|
|
|
|
alias wifi "sudo nmtui"
|
2020-11-06 11:37:55 -06:00
|
|
|
alias svim "sudo -E nvim"
|
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-01-16 17:01:59 -06:00
|
|
|
|
|
|
|
# weechat aliases
|
|
|
|
function chat
|
2020-01-20 09:12:52 -06:00
|
|
|
set -l pass (pass config/weechat-passphrase | head -n 1)
|
2020-01-22 17:25:47 -06:00
|
|
|
env WEECHAT_PASSPHRASE=$pass weechat
|
2020-01-16 17:01:59 -06:00
|
|
|
end
|
2020-04-21 16:38:58 -05:00
|
|
|
|
2020-07-02 11:17:42 -05:00
|
|
|
function rgl
|
|
|
|
# ripgrep | less
|
|
|
|
rg --color always $argv | less -r
|
|
|
|
end
|
|
|
|
|
2020-11-20 15:27:02 -06:00
|
|
|
# kubernetes aliases
|
|
|
|
alias k "kubectl"
|
|
|
|
alias kg "k get"
|
|
|
|
|
2020-04-21 16:38:58 -05:00
|
|
|
# grep aliases
|
|
|
|
alias rg "rg --text"
|
|
|
|
alias grep "rg"
|
2020-11-05 22:29:58 -06:00
|
|
|
|
|
|
|
alias vim nvim
|
|
|
|
alias vi nvim
|
|
|
|
|