This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/apps/shell/fish/aliases.fish

112 lines
2.7 KiB
Fish
Raw Normal View History

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'
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."
if scount $argv
cd $argv || exit 1
2020-01-16 17:01:59 -06:00
else
cd $NICE_HOME || exit 1
end
la
2020-01-16 17:01:59 -06:00
end
function c -w cd --description "Quickly jump to a subdirectory of NICE_HOME (or just to NICE_HOME if none given)"
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"
alias cde "d $ENV_PATH"
alias cdc "d $XDG_CONFIG_HOME"
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"
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
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"
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)'
alias mount 'sudo -E mount'
2020-01-20 14:01:06 -06:00
alias pa pulsemixer
alias mail neomutt
2021-03-04 10:26:47 -06:00
alias wje work-journal-entry