Demodularize/monolithicize

+665 -3
zsh/.zshrc
···
# systemd aliases
zplug "plugins/systemd", from:oh-my-zsh
-
# Load file from ~/.zshrc.d
-
zplug "${HOME}/.zshrc.d", from:local, use:'*'
-
export SHELL=/usr/bin/zsh
if ! zplug check; then
···
# Automatically remove duplicates from these arrays
typeset -gU path cdpath manpath fpath
···
# systemd aliases
zplug "plugins/systemd", from:oh-my-zsh
export SHELL=/usr/bin/zsh
if ! zplug check; then
···
# 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
+
+
# The ls family
+
if test -f /bin/lsd; then
+
alias ls='lsd'
+
alias la='lsd -a'
+
alias ll='lsd -l'
+
alias lal='lsd -al'
+
else
+
alias ls='ls --color=auto'
+
alias la='ls -a'
+
alias ll='ls -l'
+
alias lal='ls -al'
+
fi
+
+
# grep
+
alias grep='grep --color'
+
+
# Prompt user before overwriting files
+
alias cp='cp -i'
+
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 cat='bat -p'
+
alias -g B='| bat'
+
fi
+
+
# Assorted global aliases
+
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 fw='sudo firewall-cmd'
+
alias fwp='sudo firewall-cmd --permanent'
+
alias fwr='sudo firewall-cmd --reload'
+
alias fwrp='sudo firewall-cmd --runtime-to-permanent'
+
fi
+
+
# git
+
alias ga='git add'
+
alias gcl='git clone'
+
alias gcmsg='git commit -m'
+
alias gd='git diff'
+
alias gl='git pull'
+
alias gp='git push'
+
alias gr='git remote'
+
alias grbi='git rebase -i'
+
alias grm='git rm'
+
alias grv='git remote -v'
+
alias gst='git status'
+
+
+
##############################################################################
+
# BINDINGS
+
##############################################################################
+
typeset -g -A key
+
+
key[Home]="${terminfo[khome]}"
+
key[End]="${terminfo[kend]}"
+
+
[[ -n "${key[Home]}" ]] && bindkey -- "${key[Home]}" beginning-of-line
+
[[ -n "${key[End]}" ]] && bindkey -- "${key[End]}" end-of-line
+
+
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
+
autoload -Uz add-zle-hook-widget
+
function zle_application_mode_start { echoti smkx }
+
function zle_application_mode_stop { echoti rmkx }
+
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
+
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
+
fi
+
+
## keybinding for convenient viewing of man pages
+
if test -x "${HOME}/bin/split-man"; then
+
split-man-widget() { "${HOME}/bin/split-man"}
+
zle -N split-man-widget
+
+
bindkey '^[m' split-man-widget
+
fi
+
+
## gumssh
+
if test -x "$(command -v gumssh)"; then
+
bindkey -s '^[s' 'gumssh^M'
+
fi
+
+
## yazi
+
if test -x "$(command -v yazi)"; then
+
bindkey -s '^[f' 'yazi^M'
+
fi
+
+
## history substring search
+
bindkey '^[[1;5A' history-substring-search-up
+
bindkey '^[[1;5B' history-substring-search-down
+
+
+
##############################################################################
+
# FUNCTIONS
+
##############################################################################
+
# Command checker helper
+
function check_cmd() {
+
test -x "$(command -v $1)"
+
}
+
+
## Nushell and jc functions
+
+
# nushell: df
+
function nudf() {
+
nu -c 'jc df | from json'
+
}
+
+
# nushell: free
+
function numem() {
+
nu -c 'jc free | from json'
+
}
+
+
# nushell: lsof -i
+
function netcons() {
+
nu -c 'jc lsof -i | from json'
+
}
+
+
# nushell: nutulp
+
function tulp() {
+
nu -c 'jc ss -tulp | from json'
+
}
+
+
# nushell: openports
+
function openports() {
+
nu -c 'sudo jc lsof -i | from json | find "LISTEN"'
+
}
+
+
# nushell: list sockets in use
+
function lsock() {
+
nu -c 'sudo jc lsof -i -P | from json'
+
}
+
+
# nushell: ping
+
function nuping() {
+
nu -c 'jc ping -c 3 $1 | from json'
+
}
+
+
# nushell: pong
+
function pong() {
+
nu -c 'jc ping -c 3 www.google.com | from json'
+
}
+
+
# nushell: uptime
+
function nuptime() {
+
nu -c 'jc uptime | from json'
+
}
+
+
# nushell: os-release
+
function os-release() {
+
cat /etc/os-release | nu -c 'jc --os-release | from json'
+
}
+
+
# nushell: timestamp Z
+
function nutsz() {
+
nu -c 'date now | format date "%FT%T%:z"'
+
}
+
+
# watch directory listing, update every 0.1s
+
function watchdir() {
+
watch -n0,1 "ls -lh $1/ | tail"
+
}
+
+
# get time in timezone
+
function timein() {
+
continent=$(find /usr/share/zoneinfo -maxdepth 1 -mindepth 1 -type d -not -name "posix" -not -name "right" -exec basename {} \; | gum choose --limit=1)
+
city=$(find "/usr/share/zoneinfo/$continent" -type f -exec basename {} \; | gum choose --limit=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
+
}
+
+
# Ansible playbook
+
function ansplay() {
+
ansible-playbook -i inventory.yml "$@"
+
}
+
+
# Create a bookmark.
+
function mark() {
+
+
if ! test -f "${HOME}/.shellmarks"; then
+
touch "${HOME}/.shellmarks"
+
fi
+
+
mark_to_add="$(pwd)"
+
+
if grep -qxFe "${mark_to_add}" "${HOME}/.shellmarks"; then
+
gum style \
+
--foreground 210 \
+
--margin "1 2" \
+
"This bookmark already exists: ${mark_to_add}"
+
else
+
echo "${mark_to_add}" >> "${HOME}/.shellmarks"
+
gum style \
+
--foreground "#73F59F" \
+
--margin "1 2" \
+
"${mark_to_add} added to shellmarks file"
+
fi
+
+
/bin/cat "${HOME}/.shellmarks" | sort | tee "${HOME}/.shellmarks" >/dev/null
+
+
return 0
+
}
+
+
# List bookmarks.
+
function lsmarks() {
+
echo "# Shellmarks" | gum format
+
+
while IFS= read -r line; do
+
echo "- $line"
+
done < "${HOME}/.shellmarks" | gum format
+
}
+
+
# Remove bookmarks.
+
function delmark() {
+
selection=$(cat "${HOME}/.shellmarks" | gum choose --no-limit)
+
+
if test -n "${selection}"; then
+
while read -r line; do
+
perl -n -i -e "print unless /^\\Q${line//\//\\/}\\E\$/" "${HOME}/.shellmarks"
+
done <<< "${selection}"
+
else
+
return 0
+
fi
+
+
gum format -t markdown -- \
+
"# The following bookmarks were deleted:" \
+
"$(printf "%s\n" "${selection}")"
+
+
return 0
+
}
+
+
# Goto a bookmark.
+
function gotomark() {
+
if ! test -f "${HOME}/.shellmarks"; then
+
echo "No bookmarks exist yet. Add some!"
+
return 1
+
fi
+
+
echo
+
builtin cd $(cat "${HOME}/.shellmarks" | gum choose --limit=1 --height=20)
+
+
local precmd
+
for precmd in $precmd_functions; do
+
$precmd
+
done
+
zle && zle reset-prompt
+
}
+
zle -N gotomark
+
bindkey '^[g' gotomark
+
+
# Choose a directory from the directory stack.
+
function dstack() {
+
echo "# Choose a directory" | gum format -t markdown
+
selection=$(dirs -lp | gum choose --limit=1)
+
cd $selection
+
}
+
+
# Print timestamp as %Y-%m-%d %H:%M:%S.
+
function tstamp() {
+
emulate -L zsh
+
date '+%Y-%m-%d %H:%M:%S' | tr -d '\n'
+
}
+
+
# Print timestamp as %Y-%m-%dT%H:%M:%S%:z
+
function tstampz() {
+
emulate -L zsh
+
date '+%Y-%m-%dT%H:%M:%S%:z' | tr -d '\n'
+
}
+
+
# zrmcomp() remove *.zwc files.
+
function zrmcomp() {
+
local i
+
for i in ${HOME}/*.zwc(N); do
+
printf "Removing $i\n"
+
command rm -f $i
+
done
+
}
+
+
# Invoke this every time you change .zshrc to recompile it.
+
function src() {
+
autoload -U zrecompile
+
[ -f ~/.zshrc ] && zrecompile -p ~/.zshrc
+
[ -f ~/.zcompdump ] && zrecompile -p ~/.zcompdump
+
[ -f ~/.zcompdump ] && zrecompile -p ~/.zcompdump
+
[ -f ~/.zshrc.zwc.old ] && command rm -f ~/.zshrc.zwc.old
+
[ -f ~/.zcompdump.zwc.old ] && command rm -f ~/.zcompdump.zwc.old
+
source ~/.zshrc
+
}
+
+
# Do an ls after cd.
+
function cd() { builtin cd "$@" && ls; }
+
+
# Create new directory and enter it.
+
function mkd() { mkdir -p "$@" && cd "$_"; }
+
+
# Display pids of commands.
+
function pids() { pgrep -a "$@"; }
+
+
# Restart zsh.
+
function restart() { exec $SHELL $SHELL_ARGS "$@"; }
+
+
# cd to ~, clear screen, and restart zsh.
+
function rsrc() { cd && clear && restart; }
+
+
# newfeelslog
+
# Usage: newfeelslog <tag0> <tag1> ... <tagN>
+
function newfeelslog() {
+
DATE=$(date '+%Y-%m-%d')
+
FEELSDIR="${HOME}/Nextcloud/sites/feels.hyperreal.coffee"
+
PREV_ENTRY=$(find "$FEELSDIR/src" -name "*.md" -exec basename {} \; | sort | tail -1 | cut -c 18-21)
+
NEXT_ENTRY="00$(echo "$PREV_ENTRY" + "1" | bc)"
+
NEXT_ENTRY_FILENAME="${FEELSDIR}/src/${DATE}-entry-${NEXT_ENTRY}.md"
+
+
cat <<EOF >"$NEXT_ENTRY_FILENAME"
+
---
+
title: Entry $NEXT_ENTRY
+
date: $(date '+%Y-%m-%d %H:%M:%S %z')
+
tags: $@
+
slug: entry-$NEXT_ENTRY
+
---
+
EOF
+
+
$EDITOR "$NEXT_ENTRY_FILENAME"
+
cd "$FEELSDIR"
+
}
+
+
+
##############################################################################
+
# FZF
+
##############################################################################
+
+
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
+
+
export FZF_DEFAULT_OPTS='--color=bg+:#302D41,bg:#1E1E2E,spinner:#F8BD96,hl:#F28FAD --color=fg:#D9E0EE,header:#F28FAD,info:#DDB6F2,pointer:#F8BD96 --color=marker:#F8BD96,fg+:#F2CDCD,prompt:#DDB6F2,hl+:#F28FAD'
+
+
## completion trigger
+
export FZF_COMPLETION_TRIGGER="~~"
+
+
## default source for fzf
+
export FZF_DEFAULT_COMMAND="fd --type f --hidden --follow --exclude .git"
+
+
# CTRL-R
+
# CTRL-Y to copy the command into clipboard using wl-copy
+
export FZF_CTRL_R_OPTS="
+
--bind 'ctrl-y:execute-silent(echo -n {2..} | wl-copy)+abort'
+
--color header:italic
+
--header 'Press CTRL-Y to copy command into clipboard'"
+
+
+
##############################################################################
+
# OPTIONS
+
##############################################################################
+
+
## General shell options
+
# See https://zsh-manual.netlify.app/options
+
+
# This is a multiple move based on zsh pattern matching (like "mmv").
+
# Read ``less ${^fpath}/zmv(N)'' for more details.
+
autoload zmv
+
+
# A builtin that can clone a running shell onto another terminal.
+
zmodload -e zsh/clone
+
+
# When listing options (by 'setopt', 'unsetopt', 'set -o', or 'set +o'),
+
# those turned on by default appear in the list prefixed with 'no'.
+
# Hence (unless KSH_OPTION_PRINT is set), 'setopt' shows all options whose
+
# settings are changed from default.
+
#
+
# Report the status of background jobs immediately, rather than waiting until
+
# just before printing a prompt.
+
setopt notify
+
+
# Allow comments even in interactive shells.
+
setopt interactivecomments
+
+
# Send *not* a HUP signal to running jobs when the shell exits.
+
setopt nohup
+
+
# If a pattern for filename generation has no matches, delete the pattern from
+
# the argument list instead of reporting an error.
+
# Overrides NOMATCH
+
setopt nullglob
+
+
# Perform =filename access
+
# $ setopt EQUALS
+
# $ echo =ls
+
# /bin/ls
+
# $ unsetopt EQUALS
+
# $ echo =ls
+
# =ls
+
# NOTE: It's not really needed because zsh sets the per default.
+
setopt equals
+
+
# Try to make completion list smaller by printing the matches in columns with
+
# different widths.
+
setopt list_packed
+
+
# Expands single letters and ranges of letters between braces
+
# $ print 1{abw-z}2
+
# $ 1a2 1b2 1w2 1y2 1z2
+
setopt braceccl
+
+
# If the argument to a cd command (or an implied cd with the AUTO_CD option
+
# set) is not a directory, and does not begin with a slash, try to expand the
+
# expression as if it were preceded by a '~' (See section 14.7 Filename
+
# Expansion).
+
setopt cdablevars
+
+
# Report the status of background and suspended jobs before exiting a shell
+
# with job control; a second attempt to exit the shell will succeed.
+
setopt checkjobs
+
+
# Make cd push the old directory onto the directory stack.
+
setopt autopushd
+
+
# Change to directory without cd
+
setopt autocd
+
+
# Query the user before executing 'rm *' or 'rm path/*'
+
setopt normstarsilent
+
setopt no_rm_star_wait
+
+
# Shaddapa you face
+
setopt nobeep
+
+
# When writing out the history file, older commands that duplicate newer ones
+
# are omitted.
+
set histsavenodups
+
+
# When searching for history entries in the line editor, do not display
+
# duplicates of a line previously found, even if the duplicates are not
+
# contiguous.
+
setopt histfindnodups
+
+
# If the internal history needs to be trimmed to add the current command line,
+
# setting this option will cause the oldest history event that has a duplicate
+
# to be lost before losing a unique event from the list.
+
setopt hist_expire_dups_first
+
+
# If a new command line being added to the history list duplicates an older
+
# one, the older command is removed from the list (even if it is not the
+
# previous event).
+
setopt hist_ignore_all_dups
+
+
# Do not enter command lines into the history list if they are duplicates of
+
# the previous event.
+
setopt hist_ignore_dups
+
+
# Remove superfluous blanks from each command line being added to history.
+
setopt hist_reduce_blanks
+
+
# Whenever the user enters a line with history expansion, don't execute the
+
# line directly; instead, perform history expansion and reload the line into
+
# the editing buffer.
+
setopt hist_verify
+
+
# Do not remove function definitions from the history list.
+
unsetopt hist_no_functions
+
+
# Remove the history (fc -l) command from the history list when invoked.
+
# Note that the command lingers in the internal history until the next command
+
# is entered before it vanishes, allowing you to briefly reuse or edit the
+
# line.
+
setopt hist_no_store
+
+
# If this is set, zsh sessions will append their history list to the history
+
# file, rather than overwrite it. Thus, multiple parallel zsh sessions will all
+
# have their history lists added to the history file, in the order they are
+
# killed.
+
setopt appendhistory
+
+
# If unset, the cursor is set to the end of the word if completion is started.
+
# Otherwise, it stays there and completion is done from both ends.
+
unsetopt completeinword
+
+
# When listing files that are possible completions, show the type of each file
+
# with a trailing identifying mark.
+
setopt listtypes
+
+
# Do not require a leading '.' in a filename to be matched explicitly.
+
setopt globdots
+
+
# List jobs in long format by default
+
setopt longlistjobs
+
+
# Don't push multiple copies of the same directory onto the directory staack.
+
setopt pushdignoredups
+
+
# This option both imports new commands from the history file, and also causes
+
# your typed commands to be appended to the history file (the latter is like
+
# specifying INC_APPEND_HISTORY).
+
# The history lines are also output with timestamps ala EXTENDED_HISTORY
+
# (which makes it easier to find the spot where we left off reading the file
+
# after it gets re-written).
+
setopt sharehistory
+
+
# Save each command's beginning timestamp (in seconds since the epoch)
+
# and the duration (in seconds) to the history file. The format of this
+
# prefixed data is:
+
# ':<beginning time>:<elapsed seconds>;<command>'
+
setopt extendedhistory
+
+
# Do *not* run all background jobs at a lower nice priority
+
unsetopt bgnice
+
+
+
##############################################################################
+
# CATPPUCCIN SYNTAX HIGHLIGHTING
+
##############################################################################
+
# Catppuccin Mocha Theme (for zsh-syntax-highlighting)
+
#
+
# Paste this files contents inside your ~/.zshrc before you activate zsh-syntax-highlighting
+
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main cursor)
+
typeset -gA ZSH_HIGHLIGHT_STYLES
+
+
# Main highlighter styling: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md
+
#
+
## General
+
### Diffs
+
### Markup
+
## Classes
+
## Comments
+
ZSH_HIGHLIGHT_STYLES[comment]='fg=#585b70'
+
## Constants
+
## Entitites
+
## Functions/methods
+
ZSH_HIGHLIGHT_STYLES[alias]='fg=#a6e3a1'
+
ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=#a6e3a1'
+
ZSH_HIGHLIGHT_STYLES[global-alias]='fg=#a6e3a1'
+
ZSH_HIGHLIGHT_STYLES[function]='fg=#a6e3a1'
+
ZSH_HIGHLIGHT_STYLES[command]='fg=#a6e3a1'
+
ZSH_HIGHLIGHT_STYLES[precommand]='fg=#a6e3a1,italic'
+
ZSH_HIGHLIGHT_STYLES[autodirectory]='fg=#fab387,italic'
+
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=#fab387'
+
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=#fab387'
+
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=#cba6f7'
+
## Keywords
+
## Built ins
+
ZSH_HIGHLIGHT_STYLES[builtin]='fg=#a6e3a1'
+
ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=#a6e3a1'
+
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=#a6e3a1'
+
## Punctuation
+
ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#f38ba8'
+
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]='fg=#cdd6f4'
+
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-unquoted]='fg=#cdd6f4'
+
ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]='fg=#cdd6f4'
+
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-delimiter]='fg=#f38ba8'
+
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=#f38ba8'
+
ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=#f38ba8'
+
## Serializable / Configuration Languages
+
## Storage
+
## Strings
+
ZSH_HIGHLIGHT_STYLES[command-substitution-quoted]='fg=#f9e2af'
+
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-quoted]='fg=#f9e2af'
+
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=#f9e2af'
+
ZSH_HIGHLIGHT_STYLES[single-quoted-argument-unclosed]='fg=#eba0ac'
+
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=#f9e2af'
+
ZSH_HIGHLIGHT_STYLES[double-quoted-argument-unclosed]='fg=#eba0ac'
+
ZSH_HIGHLIGHT_STYLES[rc-quote]='fg=#f9e2af'
+
## Variables
+
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]='fg=#cdd6f4'
+
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument-unclosed]='fg=#eba0ac'
+
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=#cdd6f4'
+
ZSH_HIGHLIGHT_STYLES[assign]='fg=#cdd6f4'
+
ZSH_HIGHLIGHT_STYLES[named-fd]='fg=#cdd6f4'
+
ZSH_HIGHLIGHT_STYLES[numeric-fd]='fg=#cdd6f4'
+
## No category relevant in spec
+
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=#eba0ac'
+
ZSH_HIGHLIGHT_STYLES[path]='fg=#cdd6f4,underline'
+
ZSH_HIGHLIGHT_STYLES[path_pathseparator]='fg=#f38ba8,underline'
+
ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=#cdd6f4,underline'
+
ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]='fg=#f38ba8,underline'
+
ZSH_HIGHLIGHT_STYLES[globbing]='fg=#cdd6f4'
+
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=#cba6f7'
+
#ZSH_HIGHLIGHT_STYLES[command-substitution]='fg=?'
+
#ZSH_HIGHLIGHT_STYLES[command-substitution-unquoted]='fg=?'
+
#ZSH_HIGHLIGHT_STYLES[process-substitution]='fg=?'
+
#ZSH_HIGHLIGHT_STYLES[arithmetic-expansion]='fg=?'
+
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-unclosed]='fg=#eba0ac'
+
ZSH_HIGHLIGHT_STYLES[redirection]='fg=#cdd6f4'
+
ZSH_HIGHLIGHT_STYLES[arg0]='fg=#cdd6f4'
+
ZSH_HIGHLIGHT_STYLES[default]='fg=#cdd6f4'
+
ZSH_HIGHLIGHT_STYLES[cursor]='fg=#cdd6f4'
-94
zsh/.zshrc.d/aliases.zsh
···
-
# 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
-
-
# The ls family
-
if test -f /bin/lsd; then
-
alias ls='lsd'
-
alias la='lsd -a'
-
alias ll='lsd -l'
-
alias lal='lsd -al'
-
else
-
alias ls='ls --color=auto'
-
alias la='ls -a'
-
alias ll='ls -l'
-
alias lal='ls -al'
-
fi
-
-
# grep
-
alias grep='grep --color'
-
-
# Prompt user before overwriting files
-
alias cp='cp -i'
-
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 cat='bat -p'
-
alias -g B='| bat'
-
fi
-
-
# Assorted global aliases
-
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 fw='sudo firewall-cmd'
-
alias fwp='sudo firewall-cmd --permanent'
-
alias fwr='sudo firewall-cmd --reload'
-
alias fwrp='sudo firewall-cmd --runtime-to-permanent'
-
fi
-
-
# git
-
alias ga='git add'
-
alias gcl='git clone'
-
alias gcmsg='git commit -m'
-
alias gd='git diff'
-
alias gl='git pull'
-
alias gp='git push'
-
alias gr='git remote'
-
alias grbi='git rebase -i'
-
alias grm='git rm'
-
alias grv='git remote -v'
-
alias gst='git status'
···
-37
zsh/.zshrc.d/bindings.zsh
···
-
typeset -g -A key
-
-
key[Home]="${terminfo[khome]}"
-
key[End]="${terminfo[kend]}"
-
-
[[ -n "${key[Home]}" ]] && bindkey -- "${key[Home]}" beginning-of-line
-
[[ -n "${key[End]}" ]] && bindkey -- "${key[End]}" end-of-line
-
-
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
-
autoload -Uz add-zle-hook-widget
-
function zle_application_mode_start { echoti smkx }
-
function zle_application_mode_stop { echoti rmkx }
-
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
-
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
-
fi
-
-
## keybinding for convenient viewing of man pages
-
if test -x "${HOME}/bin/split-man"; then
-
split-man-widget() { "${HOME}/bin/split-man"}
-
zle -N split-man-widget
-
-
bindkey '^[m' split-man-widget
-
fi
-
-
## gumssh
-
if test -x "$(command -v gumssh)"; then
-
bindkey -s '^[s' 'gumssh^M'
-
fi
-
-
## yazi
-
if test -x "$(command -v yazi)"; then
-
bindkey -s '^[f' 'yazi^M'
-
fi
-
-
## history substring search
-
bindkey '^[[1;5A' history-substring-search-up
-
bindkey '^[[1;5B' history-substring-search-down
···
-74
zsh/.zshrc.d/catppuccin_mocha-zsh-syntax-highlighting.zsh
···
-
# Catppuccin Mocha Theme (for zsh-syntax-highlighting)
-
#
-
# Paste this files contents inside your ~/.zshrc before you activate zsh-syntax-highlighting
-
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main cursor)
-
typeset -gA ZSH_HIGHLIGHT_STYLES
-
-
# Main highlighter styling: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md
-
#
-
## General
-
### Diffs
-
### Markup
-
## Classes
-
## Comments
-
ZSH_HIGHLIGHT_STYLES[comment]='fg=#585b70'
-
## Constants
-
## Entitites
-
## Functions/methods
-
ZSH_HIGHLIGHT_STYLES[alias]='fg=#a6e3a1'
-
ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=#a6e3a1'
-
ZSH_HIGHLIGHT_STYLES[global-alias]='fg=#a6e3a1'
-
ZSH_HIGHLIGHT_STYLES[function]='fg=#a6e3a1'
-
ZSH_HIGHLIGHT_STYLES[command]='fg=#a6e3a1'
-
ZSH_HIGHLIGHT_STYLES[precommand]='fg=#a6e3a1,italic'
-
ZSH_HIGHLIGHT_STYLES[autodirectory]='fg=#fab387,italic'
-
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=#fab387'
-
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=#fab387'
-
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=#cba6f7'
-
## Keywords
-
## Built ins
-
ZSH_HIGHLIGHT_STYLES[builtin]='fg=#a6e3a1'
-
ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=#a6e3a1'
-
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=#a6e3a1'
-
## Punctuation
-
ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#f38ba8'
-
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]='fg=#cdd6f4'
-
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-unquoted]='fg=#cdd6f4'
-
ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]='fg=#cdd6f4'
-
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-delimiter]='fg=#f38ba8'
-
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=#f38ba8'
-
ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=#f38ba8'
-
## Serializable / Configuration Languages
-
## Storage
-
## Strings
-
ZSH_HIGHLIGHT_STYLES[command-substitution-quoted]='fg=#f9e2af'
-
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-quoted]='fg=#f9e2af'
-
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=#f9e2af'
-
ZSH_HIGHLIGHT_STYLES[single-quoted-argument-unclosed]='fg=#eba0ac'
-
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=#f9e2af'
-
ZSH_HIGHLIGHT_STYLES[double-quoted-argument-unclosed]='fg=#eba0ac'
-
ZSH_HIGHLIGHT_STYLES[rc-quote]='fg=#f9e2af'
-
## Variables
-
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]='fg=#cdd6f4'
-
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument-unclosed]='fg=#eba0ac'
-
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=#cdd6f4'
-
ZSH_HIGHLIGHT_STYLES[assign]='fg=#cdd6f4'
-
ZSH_HIGHLIGHT_STYLES[named-fd]='fg=#cdd6f4'
-
ZSH_HIGHLIGHT_STYLES[numeric-fd]='fg=#cdd6f4'
-
## No category relevant in spec
-
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=#eba0ac'
-
ZSH_HIGHLIGHT_STYLES[path]='fg=#cdd6f4,underline'
-
ZSH_HIGHLIGHT_STYLES[path_pathseparator]='fg=#f38ba8,underline'
-
ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=#cdd6f4,underline'
-
ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]='fg=#f38ba8,underline'
-
ZSH_HIGHLIGHT_STYLES[globbing]='fg=#cdd6f4'
-
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=#cba6f7'
-
#ZSH_HIGHLIGHT_STYLES[command-substitution]='fg=?'
-
#ZSH_HIGHLIGHT_STYLES[command-substitution-unquoted]='fg=?'
-
#ZSH_HIGHLIGHT_STYLES[process-substitution]='fg=?'
-
#ZSH_HIGHLIGHT_STYLES[arithmetic-expansion]='fg=?'
-
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-unclosed]='fg=#eba0ac'
-
ZSH_HIGHLIGHT_STYLES[redirection]='fg=#cdd6f4'
-
ZSH_HIGHLIGHT_STYLES[arg0]='fg=#cdd6f4'
-
ZSH_HIGHLIGHT_STYLES[default]='fg=#cdd6f4'
-
ZSH_HIGHLIGHT_STYLES[cursor]='fg=#cdd6f4'
···
-273
zsh/.zshrc.d/functions.zsh
···
-
# Command checker helper
-
function check_cmd() {
-
test -x "$(command -v $1)"
-
}
-
-
## Nushell and jc functions
-
-
# nushell: df
-
function nudf() {
-
nu -c 'jc df | from json'
-
}
-
-
# nushell: free
-
function numem() {
-
nu -c 'jc free | from json'
-
}
-
-
# nushell: lsof -i
-
function netcons() {
-
nu -c 'jc lsof -i | from json'
-
}
-
-
# nushell: nutulp
-
function tulp() {
-
nu -c 'jc ss -tulp | from json'
-
}
-
-
# nushell: openports
-
function openports() {
-
nu -c 'sudo jc lsof -i | from json | find "LISTEN"'
-
}
-
-
# nushell: list sockets in use
-
function lsock() {
-
nu -c 'sudo jc lsof -i -P | from json'
-
}
-
-
# nushell: ping
-
function nuping() {
-
nu -c 'jc ping -c 3 $1 | from json'
-
}
-
-
# nushell: pong
-
function pong() {
-
nu -c 'jc ping -c 3 www.google.com | from json'
-
}
-
-
# nushell: uptime
-
function nuptime() {
-
nu -c 'jc uptime | from json'
-
}
-
-
# nushell: os-release
-
function os-release() {
-
cat /etc/os-release | nu -c 'jc --os-release | from json'
-
}
-
-
# nushell: timestamp Z
-
function nutsz() {
-
nu -c 'date now | format date "%FT%T%:z"'
-
}
-
-
# watch directory listing, update every 0.1s
-
function watchdir() {
-
watch -n0,1 "ls -lh $1/ | tail"
-
}
-
-
# get time in timezone
-
function timein() {
-
continent=$(find /usr/share/zoneinfo -maxdepth 1 -mindepth 1 -type d -not -name "posix" -not -name "right" -exec basename {} \; | gum choose --limit=1)
-
city=$(find "/usr/share/zoneinfo/$continent" -type f -exec basename {} \; | gum choose --limit=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
-
}
-
-
# Ansible playbook
-
function ansplay() {
-
ansible-playbook -i inventory.yml "$@"
-
}
-
-
# Create a bookmark.
-
function mark() {
-
-
if ! test -f "${HOME}/.shellmarks"; then
-
touch "${HOME}/.shellmarks"
-
fi
-
-
mark_to_add="$(pwd)"
-
-
if grep -qxFe "${mark_to_add}" "${HOME}/.shellmarks"; then
-
gum style \
-
--foreground 210 \
-
--margin "1 2" \
-
"This bookmark already exists: ${mark_to_add}"
-
else
-
echo "${mark_to_add}" >> "${HOME}/.shellmarks"
-
gum style \
-
--foreground "#73F59F" \
-
--margin "1 2" \
-
"${mark_to_add} added to shellmarks file"
-
fi
-
-
/bin/cat "${HOME}/.shellmarks" | sort | tee "${HOME}/.shellmarks" >/dev/null
-
-
return 0
-
}
-
-
# List bookmarks.
-
function lsmarks() {
-
echo "# Shellmarks" | gum format
-
-
while IFS= read -r line; do
-
echo "- $line"
-
done < "${HOME}/.shellmarks" | gum format
-
}
-
-
# Remove bookmarks.
-
function delmark() {
-
selection=$(cat "${HOME}/.shellmarks" | gum choose --no-limit)
-
-
if test -n "${selection}"; then
-
while read -r line; do
-
perl -n -i -e "print unless /^\\Q${line//\//\\/}\\E\$/" "${HOME}/.shellmarks"
-
done <<< "${selection}"
-
else
-
return 0
-
fi
-
-
gum format -t markdown -- \
-
"# The following bookmarks were deleted:" \
-
"$(printf "%s\n" "${selection}")"
-
-
return 0
-
}
-
-
# Goto a bookmark.
-
function gotomark() {
-
if ! test -f "${HOME}/.shellmarks"; then
-
echo "No bookmarks exist yet. Add some!"
-
return 1
-
fi
-
-
echo
-
builtin cd $(cat "${HOME}/.shellmarks" | gum choose --limit=1 --height=20)
-
-
local precmd
-
for precmd in $precmd_functions; do
-
$precmd
-
done
-
zle && zle reset-prompt
-
}
-
zle -N gotomark
-
bindkey '^[g' gotomark
-
-
# Choose a directory from the directory stack.
-
function dstack() {
-
echo "# Choose a directory" | gum format -t markdown
-
selection=$(dirs -lp | gum choose --limit=1)
-
cd $selection
-
}
-
-
# Print timestamp as %Y-%m-%d %H:%M:%S.
-
function tstamp() {
-
emulate -L zsh
-
date '+%Y-%m-%d %H:%M:%S' | tr -d '\n'
-
}
-
-
# Print timestamp as %Y-%m-%dT%H:%M:%S%:z
-
function tstampz() {
-
emulate -L zsh
-
date '+%Y-%m-%dT%H:%M:%S%:z' | tr -d '\n'
-
}
-
-
# Create a /overview/ of all available function()'s; the description for
-
# each funtion() *must* be the first line above the string `function'!
-
# Otherwise it wont work.
-
# Display all function()'s with their descriptions.
-
function funlist() {
-
grep -B 1 "^function" $HOME/.zshrc.d/functions.zsh | \
-
grep -v "^\-\-$" | \
-
awk '{ if(/^#/) { gsub(/^#[:space:]*/, ""); ht=$0 }; getline; gsub(/ ?\(\)/, ":"); printf("-> %-20s %s\n", $2, ht); }' | \
-
sort -u -k 3
-
}
-
-
# zrmcomp() remove *.zwc files.
-
function zrmcomp() {
-
local i
-
for i in ${HOME}/*.zwc(N); do
-
printf "Removing $i\n"
-
command rm -f $i
-
done
-
}
-
-
# Invoke this every time you change .zshrc to recompile it.
-
function src() {
-
autoload -U zrecompile
-
[ -f ~/.zshrc ] && zrecompile -p ~/.zshrc
-
[ -f ~/.zcompdump ] && zrecompile -p ~/.zcompdump
-
[ -f ~/.zcompdump ] && zrecompile -p ~/.zcompdump
-
[ -f ~/.zshrc.zwc.old ] && command rm -f ~/.zshrc.zwc.old
-
[ -f ~/.zcompdump.zwc.old ] && command rm -f ~/.zcompdump.zwc.old
-
source ~/.zshrc
-
}
-
-
# Do an ls after cd.
-
function cd() { builtin cd "$@" && ls; }
-
-
# Create new directory and enter it.
-
function mkd() { mkdir -p "$@" && cd "$_"; }
-
-
# Display pids of commands.
-
function pids() { pgrep -a "$@"; }
-
-
# Restart zsh.
-
function restart() { exec $SHELL $SHELL_ARGS "$@"; }
-
-
# cd to ~, clear screen, and restart zsh.
-
function rsrc() { cd && clear && restart; }
-
-
# newfeelslog
-
# Usage: newfeelslog <tag0> <tag1> ... <tagN>
-
function newfeelslog() {
-
DATE=$(date '+%Y-%m-%d')
-
FEELSDIR="${HOME}/Nextcloud/sites/feels.hyperreal.coffee"
-
PREV_ENTRY=$(find "$FEELSDIR/src" -name "*.md" -exec basename {} \; | sort | tail -1 | cut -c 18-21)
-
NEXT_ENTRY="00$(echo "$PREV_ENTRY" + "1" | bc)"
-
NEXT_ENTRY_FILENAME="${FEELSDIR}/src/${DATE}-entry-${NEXT_ENTRY}.md"
-
-
cat <<EOF >"$NEXT_ENTRY_FILENAME"
-
---
-
title: Entry $NEXT_ENTRY
-
date: $(date '+%Y-%m-%d %H:%M:%S %z')
-
tags: $@
-
slug: entry-$NEXT_ENTRY
-
---
-
EOF
-
-
$EDITOR "$NEXT_ENTRY_FILENAME"
-
cd "$FEELSDIR"
-
}
···
-18
zsh/.zshrc.d/fzf.zsh
···
-
# ~/.zshrc.d/fzf.zsh
-
-
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
-
-
export FZF_DEFAULT_OPTS='--color=bg+:#302D41,bg:#1E1E2E,spinner:#F8BD96,hl:#F28FAD --color=fg:#D9E0EE,header:#F28FAD,info:#DDB6F2,pointer:#F8BD96 --color=marker:#F8BD96,fg+:#F2CDCD,prompt:#DDB6F2,hl+:#F28FAD'
-
-
## completion trigger
-
export FZF_COMPLETION_TRIGGER="~~"
-
-
## default source for fzf
-
export FZF_DEFAULT_COMMAND="fd --type f --hidden --follow --exclude .git"
-
-
# CTRL-R
-
# CTRL-Y to copy the command into clipboard using wl-copy
-
export FZF_CTRL_R_OPTS="
-
--bind 'ctrl-y:execute-silent(echo -n {2..} | wl-copy)+abort'
-
--color header:italic
-
--header 'Press CTRL-Y to copy command into clipboard'"
···
-151
zsh/.zshrc.d/options.zsh
···
-
## General shell options
-
# See https://zsh-manual.netlify.app/options
-
-
# This is a multiple move based on zsh pattern matching (like "mmv").
-
# Read ``less ${^fpath}/zmv(N)'' for more details.
-
autoload zmv
-
-
# A builtin that can clone a running shell onto another terminal.
-
zmodload -e zsh/clone
-
-
# When listing options (by 'setopt', 'unsetopt', 'set -o', or 'set +o'),
-
# those turned on by default appear in the list prefixed with 'no'.
-
# Hence (unless KSH_OPTION_PRINT is set), 'setopt' shows all options whose
-
# settings are changed from default.
-
#
-
# Report the status of background jobs immediately, rather than waiting until
-
# just before printing a prompt.
-
setopt notify
-
-
# Allow comments even in interactive shells.
-
setopt interactivecomments
-
-
# Send *not* a HUP signal to running jobs when the shell exits.
-
setopt nohup
-
-
# If a pattern for filename generation has no matches, delete the pattern from
-
# the argument list instead of reporting an error.
-
# Overrides NOMATCH
-
setopt nullglob
-
-
# Perform =filename access
-
# $ setopt EQUALS
-
# $ echo =ls
-
# /bin/ls
-
# $ unsetopt EQUALS
-
# $ echo =ls
-
# =ls
-
# NOTE: It's not really needed because zsh sets the per default.
-
setopt equals
-
-
# Try to make completion list smaller by printing the matches in columns with
-
# different widths.
-
setopt list_packed
-
-
# Expands single letters and ranges of letters between braces
-
# $ print 1{abw-z}2
-
# $ 1a2 1b2 1w2 1y2 1z2
-
setopt braceccl
-
-
# If the argument to a cd command (or an implied cd with the AUTO_CD option
-
# set) is not a directory, and does not begin with a slash, try to expand the
-
# expression as if it were preceded by a '~' (See section 14.7 Filename
-
# Expansion).
-
setopt cdablevars
-
-
# Report the status of background and suspended jobs before exiting a shell
-
# with job control; a second attempt to exit the shell will succeed.
-
setopt checkjobs
-
-
# Make cd push the old directory onto the directory stack.
-
setopt autopushd
-
-
# Change to directory without cd
-
setopt autocd
-
-
# Query the user before executing 'rm *' or 'rm path/*'
-
setopt normstarsilent
-
setopt no_rm_star_wait
-
-
# Shaddapa you face
-
setopt nobeep
-
-
# When writing out the history file, older commands that duplicate newer ones
-
# are omitted.
-
set histsavenodups
-
-
# When searching for history entries in the line editor, do not display
-
# duplicates of a line previously found, even if the duplicates are not
-
# contiguous.
-
setopt histfindnodups
-
-
# If the internal history needs to be trimmed to add the current command line,
-
# setting this option will cause the oldest history event that has a duplicate
-
# to be lost before losing a unique event from the list.
-
setopt hist_expire_dups_first
-
-
# If a new command line being added to the history list duplicates an older
-
# one, the older command is removed from the list (even if it is not the
-
# previous event).
-
setopt hist_ignore_all_dups
-
-
# Do not enter command lines into the history list if they are duplicates of
-
# the previous event.
-
setopt hist_ignore_dups
-
-
# Remove superfluous blanks from each command line being added to history.
-
setopt hist_reduce_blanks
-
-
# Whenever the user enters a line with history expansion, don't execute the
-
# line directly; instead, perform history expansion and reload the line into
-
# the editing buffer.
-
setopt hist_verify
-
-
# Do not remove function definitions from the history list.
-
unsetopt hist_no_functions
-
-
# Remove the history (fc -l) command from the history list when invoked.
-
# Note that the command lingers in the internal history until the next command
-
# is entered before it vanishes, allowing you to briefly reuse or edit the
-
# line.
-
setopt hist_no_store
-
-
# If this is set, zsh sessions will append their history list to the history
-
# file, rather than overwrite it. Thus, multiple parallel zsh sessions will all
-
# have their history lists added to the history file, in the order they are
-
# killed.
-
setopt appendhistory
-
-
# If unset, the cursor is set to the end of the word if completion is started.
-
# Otherwise, it stays there and completion is done from both ends.
-
unsetopt completeinword
-
-
# When listing files that are possible completions, show the type of each file
-
# with a trailing identifying mark.
-
setopt listtypes
-
-
# Do not require a leading '.' in a filename to be matched explicitly.
-
setopt globdots
-
-
# List jobs in long format by default
-
setopt longlistjobs
-
-
# Don't push multiple copies of the same directory onto the directory staack.
-
setopt pushdignoredups
-
-
# This option both imports new commands from the history file, and also causes
-
# your typed commands to be appended to the history file (the latter is like
-
# specifying INC_APPEND_HISTORY).
-
# The history lines are also output with timestamps ala EXTENDED_HISTORY
-
# (which makes it easier to find the spot where we left off reading the file
-
# after it gets re-written).
-
setopt sharehistory
-
-
# Save each command's beginning timestamp (in seconds since the epoch)
-
# and the duration (in seconds) to the history file. The format of this
-
# prefixed data is:
-
# ':<beginning time>:<elapsed seconds>;<command>'
-
setopt extendedhistory
-
-
# Do *not* run all background jobs at a lower nice priority
-
unsetopt bgnice
···