Clean up

Changed files
+18 -113
zsh
+18 -113
zsh/.zshrc
···
# Use syntax highlighting when typing commands
zplug "zsh-users/zsh-syntax-highlighting", defer:2
-
# Use Arch Linux aliases
-
zplug "plugins/archlinux", from:oh-my-zsh
-
# Press escape twice to prepend `sudo` to the command line
zplug "plugins/sudo", from:oh-my-zsh
···
zplug load
-
# -----------------------------------------------------------------------------
-
# ENVIRONMENT VARS
-
# -----------------------------------------------------------------------------
+
### ENVIRONMENT VARS
export PAGER="less -FRX"
export MANWIDTH="88"
export MANROFFOPT="-c"
···
# Set PATH
export PATH="/bin:/sbin:/usr/local/bin"
-
# Add homebrew to PATH
-
export PATH="/home/linuxbrew/.linuxbrew/bin:${PATH}"
+
# Add homebrew to PATH if it exists
+
if [ -d "/home/linuxbrew/.linuxbrew/bin" ]; then
+
export PATH="/home/linuxbrew/.linuxbrew/bin:${PATH}"
+
fi
# Add ~/.local/bin to PATH
export PATH="${HOME}/.local/bin:${PATH}"
···
export PATH="${HOME}/.cargo/bin:${PATH}"
fi
+
# Automatically remove duplicates from these arrays
+
typeset -gU path cdpath manpath fpath
+
# fzf
source <(fzf --zsh)
# starship.rs
eval "$(starship init zsh)"
-
# Automatically remove duplicates from these arrays
-
typeset -gU path cdpath manpath fpath
-
-
-
##############################################################################
-
# ALIASES
-
##############################################################################
-
# Aliases for APT
-
if [ -e "/etc/debian_version" ]; then
-
alias acs='sudo apt-cache search'
-
alias acp='sudo apt-cache policy'
-
alias agu='sudo apt update'
-
alias agud='sudo apt update && sudo apt dist-upgrade'
-
alias agi='sudo apt install'
-
alias afs='sudo apt-file search'
-
alias afu='sudo apt-file update'
-
alias aac='sudo apt autoclean'
-
alias agc='sudo apt clean'
-
alias agli='sudo apt list --installed'
-
alias agp='sudo apt purge'
-
alias agr='sudo apt remove'
-
alias agar='sudo apt autoremove'
-
fi
-
-
# Aliases for DNF
-
if [ -e "/etc/redhat-release" ]; then
-
alias dnfc='sudo dnf clean all'
-
alias dnfgi='sudo dnf groupinstall'
-
alias dnfgl='dnf grouplist'
-
alias dnfgr='sudo dnf groupremove'
-
alias dnfi='sudo dnf install'
-
alias dnfl='dnf list'
-
alias dnfli='dnf list installed'
-
alias dnfmc='dnf makecache'
-
alias dnfp='dnf info'
-
alias dnfr='sudo dnf remove'
-
alias dnfs='dnf search'
-
alias dnfu='sudo dnf update'
-
fi
+
### ALIASES
# The ls family
if test -f /bin/lsd; then
···
alias mv='mv -i'
alias rm='rm -i'
-
# Display zsh functions with bat
-
alias zfun='functions | bat -l zsh'
-
-
# Use bat
-
if command -v bat >/dev/null; then
-
alias -g B='| bat'
-
fi
-
# convert just recipes into aliases
for recipe in $(just --justfile ~/.justfile --summary); do
alias $recipe="just --justfile ~/.justfile --working-directory . $recipe"
done
# Assorted global aliases
+
if command -v bat >/dev/null; then
+
alias -g B='| bat'
+
fi
alias -g H='| head'
alias -g T='| tail'
alias -g G='| grep'
alias -g L='| less -FRX'
alias -g CC='| xclip -selection clipboard'
-
-
# Get public IP address
-
alias pubip4='curl -s -m 5 ipv4.icanhazip.com'
-
alias pubip6='curl -s -m 5 ipv6.icanhazip.com'
# firewalld
if test -x "$(command -v firewall-cmd)"; then
···
alias todo="todo.sh"
fi
-
##############################################################################
-
# BINDINGS
-
##############################################################################
+
### BINDINGS
typeset -g -A key
key[Home]="${terminfo[khome]}"
···
fi
## keybinding for convenient viewing of man pages
-
if test -x "${HOME}/bin/split-man"; then
+
if test -x "${HOME}/bin/split_man"; then
split-man-widget() {
-
"${HOME}/bin/split-man"
+
"${HOME}/bin/split_man"
}
zle -N split-man-widget
···
bindkey '^[[1;5A' history-substring-search-up
bindkey '^[[1;5B' history-substring-search-down
+
### FUNCTIONS
-
##############################################################################
-
# FUNCTIONS
-
##############################################################################
# Command checker helper
function check_cmd() {
test -x "$(command -v $1)"
···
TZ="$continent/$city" date
}
-
# Generate a pseudo-random 16-character string.
-
function genrand() {
-
openssl rand -base64 16
-
}
-
-
# Remove ~/.ssh/known_hosts*
-
function rmknownhosts() {
-
rm -v "${HOME}/.ssh/known_hosts"*
-
}
-
-
# Copy SSH public key to clipboard (requires xclip -selection clipboard)
-
function pubkey() {
-
cat "${HOME}/.ssh/id_ed25519.pub" | tr -d '\n' | xclip -selection clipboard
-
echo "--> SSH public key copied to clipboard"
-
}
-
-
# Remove all .jpeg .jpg .png .svg .webp files from downloads
-
function rmpics() {
-
find "${HOME}/downloads" \
-
-maxdepth 1 \
-
-type f \
-
\( -name "*.jpg" -o -name "*.jpg_original" -o -name "*.jpeg" -o -name "*.svg" -o -name "*.png" -o -name "*.webp" \) \
-
-delete
-
}
-
-
# Remove all ISOs and disc images from downloads
-
function rmisos() {
-
find "${HOME}/downloads" \
-
-maxdepth 1 \
-
-type f \
-
\( -name "*.iso" -o -name "*.img" \) \
-
-delete
-
}
-
-
# Clear downloads folder
-
function cldl() {
-
rm -rf "${HOME}/downloads/"*
-
}
-
# Ansible playbook
function ansplay() {
ansible-playbook -i inventory.yml "$@"
···
cd && clear && restart;
}
-
-
##############################################################################
-
# FZF
-
##############################################################################
+
### FZF
export FZF_DEFAULT_OPTS=" \
--color=bg+:#313244,bg:#1E1E2E,spinner:#F5E0DC,hl:#F38BA8 \
···
--header 'Press CTRL-Y to copy command into clipboard'"
-
##############################################################################
-
# OPTIONS
-
##############################################################################
+
### OPTIONS
## General shell options
# See https://zsh-manual.netlify.app/options