2022-03-18 17:50:20 -07:00
|
|
|
#!/bin/sh
|
|
|
|
## Short hand programs (ex: sc = shellcheck) >>>
|
|
|
|
# use nvim rather than vim if the command exists
|
2022-04-14 21:34:56 -07:00
|
|
|
alias \
|
|
|
|
vimdiff='nvim -d' \
|
2022-03-18 17:50:20 -07:00
|
|
|
|
2022-07-19 14:44:54 -07:00
|
|
|
alias sd=sudo
|
|
|
|
|
2022-04-14 21:34:56 -07:00
|
|
|
alias \
|
|
|
|
vv='$EDITOR' \
|
|
|
|
e='$EDITOR' \
|
2022-04-19 23:43:34 -07:00
|
|
|
svv='sudoedit' \
|
2022-03-18 17:50:20 -07:00
|
|
|
|
|
|
|
# I do this too much by accident smh my head
|
2022-04-14 21:34:56 -07:00
|
|
|
alias \
|
|
|
|
:q='exit' \
|
|
|
|
q='exit' \
|
2022-03-18 17:50:20 -07:00
|
|
|
|
|
|
|
# rmdir is long
|
2022-04-14 21:34:56 -07:00
|
|
|
alias \
|
2022-03-18 17:50:20 -07:00
|
|
|
rmd='rmdir' \
|
2022-04-14 21:34:56 -07:00
|
|
|
rd='rmdir' \
|
2022-03-18 17:50:20 -07:00
|
|
|
|
2022-04-25 13:59:49 -07:00
|
|
|
# opt for trash-cli over rm
|
2022-05-13 04:26:49 -07:00
|
|
|
if command -v trash > /dev/null; then
|
2022-04-25 13:59:49 -07:00
|
|
|
alias rm=trash
|
|
|
|
fi
|
|
|
|
|
2022-11-05 17:18:20 -07:00
|
|
|
# git
|
|
|
|
alias g=git
|
2022-03-18 17:50:20 -07:00
|
|
|
|
|
|
|
# <<<
|
|
|
|
## Program improvements (ex: ls = ls -h) >>>
|
2022-07-19 14:44:54 -07:00
|
|
|
alias sudo='sudo VISUAL="$VISUAL" SYSTEMD_EDITOR="$SYSTEMD_EDITOR" ' # allow using aliases in sudo commands and add some env vars
|
2022-03-18 17:50:20 -07:00
|
|
|
alias df='df -h' # Human-readable sizes
|
|
|
|
alias free='free -m' # Show sizes in MB
|
|
|
|
alias bc='bc -ql' # Make bc usable for fast math
|
2024-05-27 04:22:09 -07:00
|
|
|
alias ffmpeg='ffmpeg -hide_banner'
|
2022-03-18 17:50:20 -07:00
|
|
|
[ -z "$VIMRUNTIME" ] &&
|
|
|
|
alias glow='glow -p' # force Glow to preview with `less` if not in vim
|
|
|
|
|
2022-04-14 21:34:56 -07:00
|
|
|
# I hate it when I get ghost script instead of git status
|
|
|
|
alias gs='echo "you don'\''t $(tput sitm)really$(tput sgr0) want ghost script now, do you?"'
|
2022-03-18 17:50:20 -07:00
|
|
|
|
|
|
|
# tell make to use all cpu cores
|
|
|
|
alias make='make -j$(nproc)'
|
|
|
|
|
|
|
|
# Colors
|
2022-04-14 21:34:56 -07:00
|
|
|
alias \
|
2022-03-18 17:50:20 -07:00
|
|
|
ls='ls -hN --color=auto --group-directories-first' \
|
BIG UPDATE: shell: add profile, move calc and mkcd to files, move
shell-independent config (aliases, functions, env vars, options) to
.config/shell/shrc, make bashrc and zshrc use the same shrc, add TTY
detection for changing caps lock to escape in a TTY, add option for
skipping plugin loading, and maybe a few other things
If this goes well, I'll be tempted to call this version 1.0. Things
have been very stable for the last few months. Although, since it's the
first really big change in a while, that might make it version 2.0?
Should dotfiles have big version numbers at all? Probably not.
2022-04-08 13:36:29 -07:00
|
|
|
grep='grep --color=auto' \
|
|
|
|
egrep='egrep --color=auto' \
|
|
|
|
fgrep='fgrep --color=auto' \
|
|
|
|
diff='diff --color=auto' \
|
|
|
|
pacman='pacman --color=auto' \
|
2022-08-09 16:54:16 -07:00
|
|
|
ip='ip -color=auto' \
|
BIG UPDATE: shell: add profile, move calc and mkcd to files, move
shell-independent config (aliases, functions, env vars, options) to
.config/shell/shrc, make bashrc and zshrc use the same shrc, add TTY
detection for changing caps lock to escape in a TTY, add option for
skipping plugin loading, and maybe a few other things
If this goes well, I'll be tempted to call this version 1.0. Things
have been very stable for the last few months. Although, since it's the
first really big change in a while, that might make it version 2.0?
Should dotfiles have big version numbers at all? Probably not.
2022-04-08 13:36:29 -07:00
|
|
|
|
|
|
|
# super duper paru alias
|
|
|
|
# shellcheck disable=SC2139
|
2022-05-24 22:15:24 -07:00
|
|
|
command -v paru > /dev/null && alias \
|
2022-07-27 23:09:25 -07:00
|
|
|
parue='\paru --color=auto --sudoloop --newsonupgrade --pgpfetch --upgrademenu --bottomup --fm nvim' \
|
2022-04-14 21:34:56 -07:00
|
|
|
paru='parue --skipreview' \
|
2022-03-18 17:50:20 -07:00
|
|
|
|
2022-07-12 17:31:00 -07:00
|
|
|
# TODO: make sure IS_TTY is set to a value in the env file, in case the profile is not installed.
|
|
|
|
if command -v lsd > /dev/null && ! ${IS_TTY:-false}; then
|
|
|
|
alias ls=lsd
|
BIG UPDATE: shell: add profile, move calc and mkcd to files, move
shell-independent config (aliases, functions, env vars, options) to
.config/shell/shrc, make bashrc and zshrc use the same shrc, add TTY
detection for changing caps lock to escape in a TTY, add option for
skipping plugin loading, and maybe a few other things
If this goes well, I'll be tempted to call this version 1.0. Things
have been very stable for the last few months. Although, since it's the
first really big change in a while, that might make it version 2.0?
Should dotfiles have big version numbers at all? Probably not.
2022-04-08 13:36:29 -07:00
|
|
|
alias lsd='lsd --group-dirs=first'
|
|
|
|
fi
|
2022-07-12 17:31:00 -07:00
|
|
|
|
2022-11-05 17:18:20 -07:00
|
|
|
# Shorter + more useful mkdir
|
|
|
|
alias mkd="mkdir -p"
|
|
|
|
|
2022-03-18 17:50:20 -07:00
|
|
|
# <<<
|
|
|
|
## Mini short-hand scripts (ex: glone = git clone) >>>
|
|
|
|
# dotfile management
|
|
|
|
alias dot='git --git-dir="$HOME/git/dotfiles" --work-tree="$HOME"'
|
|
|
|
alias d='git --git-dir="$HOME/git/dotfiles" --work-tree="$HOME"' # duplicate for auto-complete
|
|
|
|
|
|
|
|
# quicker shutdown
|
|
|
|
alias sdn='shutdown now'
|
|
|
|
|
|
|
|
# open a new session called 0, but if there is already a session called 0, connect to it
|
|
|
|
alias tm='tmux new -As0'
|
|
|
|
|
2022-08-14 16:00:03 -07:00
|
|
|
# *sigh*...
|
2022-09-10 20:06:40 -07:00
|
|
|
alias cd-='cd -'
|
2022-08-14 16:00:03 -07:00
|
|
|
|
2022-03-18 17:50:20 -07:00
|
|
|
# List available X displays. Useful for finding what display to export when connected over ssh.
|
|
|
|
alias lsx='ls /tmp/.X11-unix | tr "X" ":"'
|
|
|
|
|
2022-11-05 17:18:20 -07:00
|
|
|
# systemctl
|
|
|
|
alias \
|
|
|
|
scl='sudo systemctl' \
|
|
|
|
sclen='sudo systemctl enable --now' \
|
|
|
|
scldn='sudo systemctl disable --now' \
|
|
|
|
scu='systemctl --user' \
|
|
|
|
|
2022-03-18 17:50:20 -07:00
|
|
|
# Make ydotool actually usable for short things
|
2022-08-12 22:30:20 -07:00
|
|
|
alias ydotool='(sudo ydotoold &) && sleep 0.08 && sudo ydotool'
|
2022-03-18 17:50:20 -07:00
|
|
|
|
|
|
|
# Update zinit and plugins
|
|
|
|
alias zup='zinit self-update && zinit update --parallel'
|
|
|
|
|
2022-07-26 02:24:48 -07:00
|
|
|
# Run PackerSync in neovim with PS
|
|
|
|
alias PS='nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync"'
|
|
|
|
|
2022-03-18 17:50:20 -07:00
|
|
|
# Edit config files
|
2022-04-14 21:34:56 -07:00
|
|
|
alias \
|
|
|
|
zc='$EDITOR ~/.zshrc' \
|
|
|
|
sc='$EDITOR $SHELL_CONFIG_DIR/shrc' \
|
|
|
|
fstab='sudoedit /etc/fstab' \
|
|
|
|
histe='$EDITOR $HISTFILE' \
|
|
|
|
|
|
|
|
# Get me to my code faster
|
|
|
|
[ -n "$C" ] && alias cdc='cd "$C" && source ../bin/utils.bashrc'
|
2022-03-18 17:50:20 -07:00
|
|
|
|
|
|
|
# Git cLONE
|
|
|
|
alias glone="git clone"
|
|
|
|
|
|
|
|
# Docker
|
2022-04-19 19:30:20 -07:00
|
|
|
alias \
|
|
|
|
logs='docker-compose logs --tail=200 -f' \
|
|
|
|
dupd='docker-compose up -d' \
|
|
|
|
ddwn='docker-compose down' \
|
|
|
|
dc='docker-compose' \
|
|
|
|
occ='docker exec -u www-data nextcloud php occ --ansi' \
|
2022-03-18 17:50:20 -07:00
|
|
|
|
2022-09-26 21:26:08 -07:00
|
|
|
# Nix
|
2023-01-11 00:23:30 -08:00
|
|
|
alias \
|
2023-07-06 18:47:49 -07:00
|
|
|
nsp='nix-shell -p' \
|
2023-01-11 00:23:30 -08:00
|
|
|
nx='$EDITOR /etc/nixos/systems/$HOST/default.nix' \
|
|
|
|
nxf='$EDITOR /etc/nixos/flake.nix' \
|
|
|
|
nxpl='sudo nix-channel --update' \
|
2023-09-04 21:45:04 -07:00
|
|
|
nxup='nxpl && sudo nixos-rebuild switch' \
|
2023-01-22 12:41:39 -08:00
|
|
|
nxfup='cd /etc/nixos; nix flake update; cd -' \
|
|
|
|
|
2022-03-18 17:50:20 -07:00
|
|
|
# file copying with a progress bar
|
|
|
|
alias cpv="rsync -ah --info=progress2"
|
|
|
|
|
|
|
|
# lists all open ports, along with some other info
|
|
|
|
alias ls-ports='netstat -tulpn'
|
|
|
|
|
|
|
|
# list all disks and their mount points
|
BIG UPDATE: shell: add profile, move calc and mkcd to files, move
shell-independent config (aliases, functions, env vars, options) to
.config/shell/shrc, make bashrc and zshrc use the same shrc, add TTY
detection for changing caps lock to escape in a TTY, add option for
skipping plugin loading, and maybe a few other things
If this goes well, I'll be tempted to call this version 1.0. Things
have been very stable for the last few months. Although, since it's the
first really big change in a while, that might make it version 2.0?
Should dotfiles have big version numbers at all? Probably not.
2022-04-08 13:36:29 -07:00
|
|
|
# shellcheck disable=SC2142
|
2022-03-18 17:50:20 -07:00
|
|
|
alias mnt="mount | awk -F' ' '{ printf \"%s\t%s\n\",\$1,\$3; }' | column -t | grep -E '^/dev/' | sort"
|
|
|
|
|
|
|
|
# backs up list of packages
|
|
|
|
alias packback='comm -23 <(paru -Qqett | sort) <(paru -Qqg base -g base-devel | sort | uniq) > ~/pkglist.txt'
|
|
|
|
|
|
|
|
# thoroughly reset the terminal
|
|
|
|
alias rce='reset && clear && exec zsh'
|
|
|
|
|
|
|
|
# find pretty much any file, quickly
|
2023-06-09 03:22:23 -07:00
|
|
|
alias fds='fd --no-ignore --hidden --exclude /run --exclude /mnt'
|
2022-03-18 17:50:20 -07:00
|
|
|
|
BIG UPDATE: shell: add profile, move calc and mkcd to files, move
shell-independent config (aliases, functions, env vars, options) to
.config/shell/shrc, make bashrc and zshrc use the same shrc, add TTY
detection for changing caps lock to escape in a TTY, add option for
skipping plugin loading, and maybe a few other things
If this goes well, I'll be tempted to call this version 1.0. Things
have been very stable for the last few months. Although, since it's the
first really big change in a while, that might make it version 2.0?
Should dotfiles have big version numbers at all? Probably not.
2022-04-08 13:36:29 -07:00
|
|
|
# Common ls aliases
|
2022-04-14 21:34:56 -07:00
|
|
|
alias \
|
|
|
|
l='ls' \
|
2024-08-31 13:49:18 -07:00
|
|
|
la='ls -ah' \
|
2022-04-14 21:34:56 -07:00
|
|
|
ll='ls -lh' \
|
2024-08-31 13:49:18 -07:00
|
|
|
lla='ls -lah' \
|
BIG UPDATE: shell: add profile, move calc and mkcd to files, move
shell-independent config (aliases, functions, env vars, options) to
.config/shell/shrc, make bashrc and zshrc use the same shrc, add TTY
detection for changing caps lock to escape in a TTY, add option for
skipping plugin loading, and maybe a few other things
If this goes well, I'll be tempted to call this version 1.0. Things
have been very stable for the last few months. Although, since it's the
first really big change in a while, that might make it version 2.0?
Should dotfiles have big version numbers at all? Probably not.
2022-04-08 13:36:29 -07:00
|
|
|
# <<<
|
|
|
|
|
|
|
|
# vim:fdm=marker:fmr=>>>,<<<:fdl=1:et:ft=bash:sw=3:ts=3
|