dotfiles/lib/alias.zsh

77 lines
1.7 KiB
Bash
Raw Normal View History

2022-08-13 13:26:55 -05:00
#!/usr/bin/env zsh
2022-08-15 13:02:04 -05:00
alias aliases="alias | sed 's/=.*//'"
alias functions="declare -f | grep '^[a-z].* ()' | sed 's/{$//'"
2021-12-08 09:38:24 -06:00
alias reload="source ~/.zshrc"
alias rr="rm -rf"
2022-08-15 13:02:04 -05:00
alias c="clear"
2021-12-08 09:38:24 -06:00
2022-08-15 13:02:04 -05:00
# ls -> lsd | swap ls for ls-deluxe if it exists
2021-12-08 09:38:24 -06:00
alias ls='ls --color=auto'
2022-08-15 13:02:04 -05:00
alias l='ls -lh'
alias la="ls -a"
alias ll="ls -lhA"
alias lr='ls -R'
alias lla="ls -la"
2022-09-22 10:21:59 -05:00
alias lsl="ls -lhFA --color=always | less"
2022-08-15 13:02:04 -05:00
alias left='ls -t -1'
2021-12-08 09:38:24 -06:00
if is-executable lsd; then
is-tty && alias lsd="lsd --icon never"
2022-06-04 11:46:08 -05:00
alias ls='lsd'
2021-12-08 09:38:24 -06:00
alias lt='lsd --tree --depth=3'
2022-08-15 13:02:04 -05:00
else
2022-08-30 23:08:24 -05:00
alias lt="tree -L 3"
2021-12-08 09:38:24 -06:00
fi
2022-08-15 13:02:04 -05:00
2021-12-08 09:38:24 -06:00
is-executable lazygit && alias lg=lazygit
2022-08-15 13:02:04 -05:00
2021-12-08 09:38:24 -06:00
alias rc="rclone --filter-from ~/.config/rclone/filter-file.txt"
2022-08-15 13:02:04 -05:00
# prefer lvim > nvim > vim
2022-08-04 00:26:32 -05:00
if is-executable lvim; then
2022-08-05 11:56:55 -05:00
alias vim=lvim
2022-08-04 00:26:32 -05:00
elif is-executable nvim; then
2022-08-05 11:56:55 -05:00
alias vim=nvim
2022-08-04 00:26:32 -05:00
fi
2022-08-15 13:02:04 -05:00
2021-12-08 09:38:24 -06:00
is-executable gdu && alias gdu -I '.*node_modules' -H
2022-08-15 13:02:04 -05:00
2021-12-08 09:38:24 -06:00
alias fzf-bat="fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'"
2022-01-04 10:42:33 -06:00
alias vivaldi="vivaldi-stable"
2022-08-15 13:02:04 -05:00
2022-01-18 15:54:21 -06:00
if is-executable zellij; then
2022-01-18 12:29:42 -06:00
alias zs="zellij -s"
alias zl="zellij ls"
alias za="zellij a"
2022-01-18 12:27:18 -06:00
fi
2022-08-15 13:02:04 -05:00
2022-03-02 12:56:40 -06:00
alias zenith="zenith -d 0 -n 0"
2022-08-15 13:02:04 -05:00
2022-06-28 11:40:20 -05:00
alias pdm-start='eval "$(pdm shell)"'
2022-08-15 13:02:04 -05:00
2022-08-30 23:08:24 -05:00
# GNU make
alias mkrt='make -C $(git rev-parse --show-toplevel)'
alias mk="make"
alias mkc="make -C"
2022-09-01 23:38:04 -05:00
alias umamba="micromamba"
2022-09-12 00:47:47 -05:00
alias g="git"
2022-10-18 14:53:33 -05:00
## TODO: make lock state aware function
is-executable gum && alias plz="gum input --prompt='🔒' --password | sudo -nS"
2022-12-10 12:18:07 -06:00
alias dockdots='docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/home/$USER/data" dots'
2023-01-16 12:54:08 -06:00
# tmux
alias t-labbook="$DOTFILES_DIR/tmux/labbook.sh"
# source custom tmux.conf with older tmux
alias tmux="tmux -f ~/.config/tmux/tmux.conf"
alias t='tmux'
alias tn='tmux new-session'
alias tl='tmux list-sessions'