mirror of
https://codeberg.org/hyperreal/home-manager
synced 2024-11-01 17:23:06 +01:00
Update
This commit is contained in:
parent
691aabcf6a
commit
0efecd739b
@ -2,38 +2,7 @@
|
|||||||
|
|
||||||
set shell := ["zsh", "-cu"]
|
set shell := ["zsh", "-cu"]
|
||||||
|
|
||||||
go-tools:
|
|
||||||
go install golang.org/x/tools/gpls@latest
|
|
||||||
go install github.com/fatih/gomodifytags@latest
|
|
||||||
go install github.com/cweill/gotests/...@latest
|
|
||||||
go install github.com/x-motemen/gore/cmd/gore@latest
|
|
||||||
go install golang.org/x/tools/cmd/guru@latest
|
|
||||||
|
|
||||||
python-tools:
|
|
||||||
pipx install --include-deps ansible
|
|
||||||
pipx install black
|
|
||||||
pipx install nose
|
|
||||||
pipx install pytest
|
|
||||||
pipx install hyfetch
|
|
||||||
pip install --user pyright
|
|
||||||
|
|
||||||
webdev-tools:
|
|
||||||
sudo npm install -g @catppuccin/inkcat
|
|
||||||
sudo npm install -g prettier
|
|
||||||
sudo npm install -g js-beautify
|
|
||||||
sudo npm install -g stylelint
|
|
||||||
sudo dnf install -y tidy
|
|
||||||
|
|
||||||
rust-tools:
|
|
||||||
source "${HOME}/.cargo/env"
|
|
||||||
cargo install cargo-binstall
|
|
||||||
cargo_pkgs=(arp-scan bandwhich bat diskonaut du-dust fblog fd hyperfine procs ripgrep skim vivid wthrr)
|
|
||||||
for pkg in "${cargo_pkgs[@]}"; do cargo-binstall -y "$pkg"; done
|
|
||||||
|
|
||||||
refresh-doom-emacs:
|
refresh-doom-emacs:
|
||||||
rm -rf "${HOME}/.config/emacs"
|
rm -rf "${HOME}/.config/emacs"
|
||||||
git clone --depth 1 https://github.com/doomemacs/doomemacs "${HOME}/.config/emacs"
|
git clone --depth 1 https://github.com/doomemacs/doomemacs "${HOME}/.config/emacs"
|
||||||
"${HOME}/.config/emacs/bin/doom" install --force --verbose
|
"${HOME}/.config/emacs/bin/doom" install --force --verbose
|
||||||
|
|
||||||
rustup:
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
||||||
|
@ -1,115 +1,115 @@
|
|||||||
# Sets user-defined palette
|
"$schema" = 'https://starship.rs/config-schema.json'
|
||||||
palette = "catppuccin_mocha"
|
|
||||||
|
|
||||||
format = """$time$container$directory$all$line_break$username$hostname$character"""
|
## PROMPT FORMAT
|
||||||
right_format = """$cmd_duration$jobs$status"""
|
format = """$time$container$directory$all$cmd_duration$jobs$status$line_break$username$hostname$character"""
|
||||||
|
|
||||||
|
# # PALETTE
|
||||||
|
palette = 'catppuccin_mocha'
|
||||||
|
|
||||||
|
[palettes.catppuccin_mocha]
|
||||||
|
rosewater = '#f5e0dc'
|
||||||
|
flamingo = '#f2cdcd'
|
||||||
|
pink = '#f5c2e7'
|
||||||
|
mauve = '#cba6f7'
|
||||||
|
red = '#f38ba8'
|
||||||
|
maroon = '#eba0ac'
|
||||||
|
peach = '#fab387'
|
||||||
|
yellow = '#f9e2af'
|
||||||
|
green = '#a6e3a1'
|
||||||
|
teal = '#94e2d5'
|
||||||
|
sky = '#89dceb'
|
||||||
|
sapphire = '#74c7ec'
|
||||||
|
blue = '#89b4fa'
|
||||||
|
lavender = '#b4befe'
|
||||||
|
text = '#cdd6f4'
|
||||||
|
subtext1 = '#bac2de'
|
||||||
|
subtext0 = '#a6adc8'
|
||||||
|
overlay2 = '#9399b2'
|
||||||
|
overlay1 = '#7f849c'
|
||||||
|
overlay0 = '#6c7086'
|
||||||
|
surface2 = '#585b70'
|
||||||
|
surface1 = '#45475a'
|
||||||
|
surface0 = '#313244'
|
||||||
|
base = '#1e1e2e'
|
||||||
|
mantle = '#181825'
|
||||||
|
crust = '#11111b'
|
||||||
|
|
||||||
|
## LEFT SIDE - FIRST LINE
|
||||||
[time]
|
[time]
|
||||||
disabled = false
|
disabled = false
|
||||||
format = '[\[ $time \]]($style) '
|
format = '[$time]($style) '
|
||||||
time_format = "%T"
|
time_format = '%T'
|
||||||
style = "bold peach"
|
style = 'bold peach'
|
||||||
|
|
||||||
[username]
|
|
||||||
format = "[$user]($style)@"
|
|
||||||
style_user = "red"
|
|
||||||
style_root = "bold red"
|
|
||||||
show_always = true
|
|
||||||
|
|
||||||
# Second param
|
|
||||||
[hostname]
|
|
||||||
format = "[$hostname]($style)"
|
|
||||||
style = "lavender"
|
|
||||||
trim_at = ".local"
|
|
||||||
ssh_only = false
|
|
||||||
disabled = false
|
|
||||||
|
|
||||||
# Third param
|
|
||||||
[directory]
|
[directory]
|
||||||
style = "subtext0"
|
style = 'subtext0'
|
||||||
truncation_length = 8
|
truncation_length = 8
|
||||||
truncate_to_repo = true
|
truncate_to_repo = true
|
||||||
truncation_symbol = "repo: "
|
truncation_symbol = 'repo: '
|
||||||
|
|
||||||
|
[docker_context]
|
||||||
|
symbol = 'docker: '
|
||||||
|
format = '[$symbol$context]($style)'
|
||||||
|
|
||||||
|
[git_branch]
|
||||||
|
symbol = ' '
|
||||||
|
|
||||||
# Before all the version info (python, nodejs, php, etc.)
|
|
||||||
[git_status]
|
[git_status]
|
||||||
style = "text"
|
style = 'text'
|
||||||
ahead = "⇡${count}"
|
ahead = '⇡${count}'
|
||||||
diverged = "⇕⇡${ahead_count}⇣${behind_count}"
|
diverged = '⇕⇡${ahead_count}⇣${behind_count}'
|
||||||
behind = "⇣${count}"
|
behind = '⇣${count}'
|
||||||
deleted = "x"
|
deleted = 'x'
|
||||||
|
|
||||||
[container]
|
[golang]
|
||||||
style = "bold pink"
|
symbol = 'go: '
|
||||||
format = "[$symbol \\[ $name \\]]($style) "
|
format = '[$symbol($version )($style)'
|
||||||
|
|
||||||
|
[nix_shell]
|
||||||
|
symbol = 'nix: '
|
||||||
|
format = '[$symbol$state(\($name\))]($style)'
|
||||||
|
|
||||||
|
[nodejs]
|
||||||
|
symbol = 'node: '
|
||||||
|
format = '[$symbol($version)]($style)'
|
||||||
|
|
||||||
|
[python]
|
||||||
|
symbol = 'py: '
|
||||||
|
format = '[${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)'
|
||||||
|
|
||||||
|
[rust]
|
||||||
|
symbol = 'rust: '
|
||||||
|
format = '[$symbol($version)]($style)'
|
||||||
|
|
||||||
# Last param in the first line/row
|
|
||||||
[cmd_duration]
|
[cmd_duration]
|
||||||
min_time = 1
|
min_time = 1
|
||||||
style = "yellow"
|
style = 'yellow'
|
||||||
format = '\[duration: [$duration]($style)\] '
|
format = 'duration: [$duration]($style) '
|
||||||
disabled = false
|
disabled = false
|
||||||
|
|
||||||
# Prompt: param 2
|
|
||||||
[character]
|
|
||||||
format = '$symbol '
|
|
||||||
success_symbol = ' [➜](bold teal)'
|
|
||||||
error_symbol = ' [➜](bold red)'
|
|
||||||
vimcmd_symbol = ' [V](bold green)'
|
|
||||||
|
|
||||||
# SYMBOLS
|
|
||||||
[status]
|
[status]
|
||||||
format = '\[exit status: [$status = $common_meaning]($style)\]'
|
format = 'exit status: [$status = $common_meaning]($style) '
|
||||||
disabled = false
|
disabled = false
|
||||||
style = "bold red"
|
style = 'bold red'
|
||||||
recognize_signal_code = true
|
recognize_signal_code = true
|
||||||
map_symbol = true
|
map_symbol = true
|
||||||
|
|
||||||
[docker_context]
|
## LEFT SIDE - SECOND LINE
|
||||||
symbol = " "
|
[username]
|
||||||
|
format = '[$user]($style)@'
|
||||||
|
style_user = 'red'
|
||||||
|
style_root = 'bold red'
|
||||||
|
show_always = true
|
||||||
|
|
||||||
[git_branch]
|
[hostname]
|
||||||
symbol = " "
|
format = '[$hostname]($style)'
|
||||||
|
style = 'lavender'
|
||||||
|
trim_at = '.local'
|
||||||
|
ssh_only = false
|
||||||
|
disabled = false
|
||||||
|
|
||||||
[golang]
|
[character]
|
||||||
symbol = " "
|
format = ' [$symbol]($style) '
|
||||||
|
success_symbol = '[➜](bold teal)'
|
||||||
[nodejs]
|
error_symbol = '[➜](bold red)'
|
||||||
symbol = " "
|
vimcmd_symbol = '[V](bold green)'
|
||||||
|
|
||||||
[package]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[python]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[rust]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[palettes.catppuccin_mocha]
|
|
||||||
rosewater = "#f5e0dc"
|
|
||||||
flamingo = "#f2cdcd"
|
|
||||||
pink = "#f5c2e7"
|
|
||||||
mauve = "#cba6f7"
|
|
||||||
red = "#f38ba8"
|
|
||||||
maroon = "#eba0ac"
|
|
||||||
peach = "#fab387"
|
|
||||||
yellow = "#f9e2af"
|
|
||||||
green = "#a6e3a1"
|
|
||||||
teal = "#94e2d5"
|
|
||||||
sky = "#89dceb"
|
|
||||||
sapphire = "#74c7ec"
|
|
||||||
blue = "#89b4fa"
|
|
||||||
lavender = "#b4befe"
|
|
||||||
text = "#cdd6f4"
|
|
||||||
subtext1 = "#bac2de"
|
|
||||||
subtext0 = "#a6adc8"
|
|
||||||
overlay2 = "#9399b2"
|
|
||||||
overlay1 = "#7f849c"
|
|
||||||
overlay0 = "#6c7086"
|
|
||||||
surface2 = "#585b70"
|
|
||||||
surface1 = "#45475a"
|
|
||||||
surface0 = "#313244"
|
|
||||||
base = "#1e1e2e"
|
|
||||||
mantle = "#181825"
|
|
||||||
crust = "#11111b"
|
|
||||||
|
105
confs/zshrc
Normal file
105
confs/zshrc
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
# Filename : ~/.zshrc
|
||||||
|
# Purpose : setup file for zsh
|
||||||
|
# Author : Jeffrey Serio <hyperreal@fedoraproject.org>
|
||||||
|
# Homepage : https://hyperreal.coffee
|
||||||
|
#
|
||||||
|
# Zsh Manual - https://zsh-manual.netlify.app
|
||||||
|
# Zsh Guide - https://zsh-guide.netlify.app
|
||||||
|
|
||||||
|
# Plugins
|
||||||
|
if ! test -f "${HOME}/.zplug/init.zsh"; then
|
||||||
|
export ZPLUG_HOME="${HOME}/.zplug"
|
||||||
|
git clone https://github.com/zplug/zplug $ZPLUG_HOME
|
||||||
|
fi
|
||||||
|
|
||||||
|
source "${HOME}/.zplug/init.zsh"
|
||||||
|
|
||||||
|
# Use autosuggestions when typing commands
|
||||||
|
zplug "zsh-users/zsh-autosuggestions"
|
||||||
|
|
||||||
|
# Use a keybinding to complete parts of command from the history file
|
||||||
|
zplug "zsh-users/zsh-history-substring-search"
|
||||||
|
|
||||||
|
# Use syntax highlighting when typing commands
|
||||||
|
zplug "zsh-users/zsh-syntax-highlighting", defer:2
|
||||||
|
|
||||||
|
# Press escape twice to prepend `sudo` to the command line
|
||||||
|
zplug "plugins/sudo", from:oh-my-zsh
|
||||||
|
|
||||||
|
# extract archives
|
||||||
|
zplug "plugins/extract", from:oh-my-zsh
|
||||||
|
|
||||||
|
# systemd aliases
|
||||||
|
zplug "plugins/systemd", from:oh-my-zsh
|
||||||
|
|
||||||
|
# Load file from ~/.zshrc.d
|
||||||
|
zplug "${HOME}/.zshrc.d", from:local, use:'*'
|
||||||
|
|
||||||
|
if ! zplug check; then
|
||||||
|
zplug install;
|
||||||
|
exec $SHELL $SHELL_ARGS "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
zplug load
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# ENVIRONMENT VARS
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
export DOOMDIR="${HOME}/shared/doom"
|
||||||
|
export PATH="${HOME}/.config/emacs/bin:${PATH}"
|
||||||
|
export LS_COLORS=$(vivid generate catppuccin-mocha)
|
||||||
|
export PAGER="less -FRX"
|
||||||
|
export MANWIDTH="88"
|
||||||
|
export MANROFFOPT="-c"
|
||||||
|
export MANPAGER="less -FRX"
|
||||||
|
export BAT_PAGER="less -FRX"
|
||||||
|
export BAT_STYLE="plain"
|
||||||
|
|
||||||
|
if test -x "$(command -v emacs)"; then
|
||||||
|
EDITOR="emacsclient"
|
||||||
|
else
|
||||||
|
EDITOR="nvim"
|
||||||
|
fi
|
||||||
|
export EDITOR
|
||||||
|
|
||||||
|
# Have less display colours
|
||||||
|
# from: https://wiki.archlinux.org/index.php/Color_output_in_console#man
|
||||||
|
export LESS_TERMCAP_mb=$'\e[1;31m' # begin bold
|
||||||
|
export LESS_TERMCAP_md=$'\e[1;34m' # begin blink
|
||||||
|
export LESS_TERMCAP_so=$'\e[01;0;33m' # begin reverse video
|
||||||
|
export LESS_TERMCAP_us=$'\e[01;31m' # begin underline
|
||||||
|
export LESS_TERMCAP_me=$'\e[0m' # reset bold/blink
|
||||||
|
export LESS_TERMCAP_se=$'\e[0m' # reset reverse video
|
||||||
|
export LESS_TERMCAP_ue=$'\e[0m' # reset underline
|
||||||
|
export GROFF_NO_SGR=1 # for konsole and gnome-terminal
|
||||||
|
|
||||||
|
# HISTSIZE is the number of lines of history that is kept within any given
|
||||||
|
# running zsh instance. SAVEHIST is the number of lines of history that is
|
||||||
|
# written out to the HISTFILE when that event occurs. If you use the
|
||||||
|
# HIST_EXPIRE_DUPS_FIRST option, setting this value larger than the SAVEHIST
|
||||||
|
# size will give you the difference as a cushion for saving duplicated history
|
||||||
|
# events.
|
||||||
|
HISTSIZE=100000
|
||||||
|
SAVEHIST=65536
|
||||||
|
|
||||||
|
# Name of the file used to store command history
|
||||||
|
HISTFILE="${HOME}/.zsh_history"
|
||||||
|
|
||||||
|
# Language
|
||||||
|
export LANG="en_US.UTF-8"
|
||||||
|
|
||||||
|
# Manpages
|
||||||
|
export MANPATH="${MANPATH:-/usr/share/man:/usr/local/share/man}"
|
||||||
|
|
||||||
|
# Automatically remove duplicates from these arrays
|
||||||
|
typeset -gU path cdpath manpath fpath
|
||||||
|
|
||||||
|
# compatibility with vterm-buffer-name-string in Emacs
|
||||||
|
autoload -U add-zsh-hook
|
||||||
|
add-zsh-hook -Uz chpwd() { print -Pn "\e]2;%m:%2~\a" }
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
eval "$(direnv hook zsh)"
|
||||||
|
|
||||||
|
# starship.rs
|
||||||
|
eval "$(starship init zsh)"
|
115
confs/zshrc.d/aliases.zsh
Normal file
115
confs/zshrc.d/aliases.zsh
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
# Aliases for APT
|
||||||
|
if [ -e "/etc/debian_version" ]; then
|
||||||
|
alias acs="sudo apt-cache search"
|
||||||
|
alias acp="sudo apt-cache policy"
|
||||||
|
alias afs="sudo apt-file search"
|
||||||
|
alias afu="sudo apt-file update"
|
||||||
|
alias aac="sudo apt autoclean"
|
||||||
|
alias agc="sudo apt clean"
|
||||||
|
alias agi="sudo apt install"
|
||||||
|
alias agli="sudo apt list --installed"
|
||||||
|
alias agp="sudo apt purge"
|
||||||
|
alias agr="sudo apt remove"
|
||||||
|
alias agu="sudo apt update"
|
||||||
|
alias agud="sudo apt update && sudo apt dist-upgrade"
|
||||||
|
alias agar="sudo apt autoremove"
|
||||||
|
fi
|
||||||
|
|
||||||
|
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 -x "$(command -v eza)"; then
|
||||||
|
alias ls='eza --git --icons'
|
||||||
|
alias la='eza --git --icons -a'
|
||||||
|
alias ll='eza --git --icons -l'
|
||||||
|
alias lal='eza --git --icons -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='trash'
|
||||||
|
alias del='/bin/rm -i'
|
||||||
|
|
||||||
|
# Display zsh functions with bat
|
||||||
|
alias zfun='functions | bat -l zsh'
|
||||||
|
|
||||||
|
# Assorted global aliases
|
||||||
|
alias -g H='| head'
|
||||||
|
alias -g T='| tail'
|
||||||
|
alias -g G='| grep'
|
||||||
|
alias -g L='| less -FRX'
|
||||||
|
alias -g B='| bat'
|
||||||
|
alias -g J='| jq'
|
||||||
|
alias -g CC='| wl-copy'
|
||||||
|
alias -g C='| wc -l'
|
||||||
|
|
||||||
|
# Get public IP address
|
||||||
|
alias pubip4='curl -s -m 5 ipv4.icanhazip.com'
|
||||||
|
alias pubip6='curl -s -m 5 ipv6.icanhazip.com'
|
||||||
|
|
||||||
|
# List apps with network connections
|
||||||
|
alias netcons='lsof -i'
|
||||||
|
|
||||||
|
# List ports
|
||||||
|
alias tulp='ss -tulp'
|
||||||
|
|
||||||
|
# List open ports
|
||||||
|
alias openports='sudo lsof -i | grep LISTEN'
|
||||||
|
|
||||||
|
# Ping google.com
|
||||||
|
alias pong='ping -c 3 www.google.com'
|
||||||
|
|
||||||
|
# Ping alias
|
||||||
|
alias ping='ping -c 3'
|
||||||
|
|
||||||
|
# List sockets in use
|
||||||
|
alias lsock='sudo lsof -i -P'
|
||||||
|
|
||||||
|
# List UDP sockets in use
|
||||||
|
alias lsocku='sudo lsof -nP | grep UDP'
|
||||||
|
|
||||||
|
# List TCP sockets in use
|
||||||
|
alias lsockt='sudo lsof -nP | grep TCP'
|
||||||
|
|
||||||
|
# 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
confs/zshrc.d/bindings.zsh
Normal file
37
confs/zshrc.d/bindings.zsh
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
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
|
@ -58,12 +58,18 @@ function rmknownhosts() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Empty trash
|
# Empty trash
|
||||||
function rubbish() {
|
function trsh() {
|
||||||
if check_cmd trash-empty; then
|
if check_cmd trash-empty; then
|
||||||
trash-empty
|
trash-empty -f
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Copy SSH public key to clipboard (requires wl-copy)
|
||||||
|
function pubkey() {
|
||||||
|
cat "${HOME}/.ssh/id_ed25519.pub" | tr -d '\n' | wl-copy
|
||||||
|
echo "--> SSH public key copied to clipboard"
|
||||||
|
}
|
||||||
|
|
||||||
# Compatibility with emacs-libvterm
|
# Compatibility with emacs-libvterm
|
||||||
function vterm_printf() {
|
function vterm_printf() {
|
||||||
if [ -n "$TMUX" ] && ([ "${TERM%%-*}" = "tmux" ] || [ "${TERM%%-*}" = "screen" ]); then
|
if [ -n "$TMUX" ] && ([ "${TERM%%-*}" = "tmux" ] || [ "${TERM%%-*}" = "screen" ]); then
|
||||||
@ -77,12 +83,12 @@ function vterm_printf() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove all .jpeg .jpg .png .svg files from downloads
|
# Remove all .jpeg .jpg .png .svg .webp files from downloads
|
||||||
function rmpics() {
|
function rmpics() {
|
||||||
find "${HOME}/downloads" \
|
find "${HOME}/downloads" \
|
||||||
-maxdepth 1 \
|
-maxdepth 1 \
|
||||||
-type f \
|
-type f \
|
||||||
\( -name "*.jpg" -o -name "*.jpg_original" -o -name "*.jpeg" -o -name "*.svg" -o -name "*.png" \) \
|
\( -name "*.jpg" -o -name "*.jpg_original" -o -name "*.jpeg" -o -name "*.svg" -o -name "*.png" -o -name "*.webp"\) \
|
||||||
-delete
|
-delete
|
||||||
}
|
}
|
||||||
|
|
||||||
|
151
confs/zshrc.d/options.zsh
Normal file
151
confs/zshrc.d/options.zsh
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
## 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
|
183
home.nix
183
home.nix
@ -1,4 +1,9 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
nixpkgs.config = {
|
nixpkgs.config = {
|
||||||
@ -36,6 +41,7 @@
|
|||||||
ripgrep
|
ripgrep
|
||||||
starship
|
starship
|
||||||
tealdeer
|
tealdeer
|
||||||
|
trash-cli
|
||||||
vivid
|
vivid
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
wthrr
|
wthrr
|
||||||
@ -51,6 +57,7 @@
|
|||||||
# # symlink to the Nix store copy.
|
# # symlink to the Nix store copy.
|
||||||
# ".screenrc".source = dotfiles/screenrc;
|
# ".screenrc".source = dotfiles/screenrc;
|
||||||
".justfile".source = confs/justfile;
|
".justfile".source = confs/justfile;
|
||||||
|
".zshrc".source = confs/zshrc;
|
||||||
".zshrc.d".source = confs/zshrc.d;
|
".zshrc.d".source = confs/zshrc.d;
|
||||||
".doom.d/config.el".source = doom.d/config.el;
|
".doom.d/config.el".source = doom.d/config.el;
|
||||||
".doom.d/init.el".source = doom.d/init.el;
|
".doom.d/init.el".source = doom.d/init.el;
|
||||||
@ -67,10 +74,10 @@
|
|||||||
themes = {
|
themes = {
|
||||||
Catppuccin-mocha = {
|
Catppuccin-mocha = {
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
owner = "catppuccin";
|
owner = "catppuccin";
|
||||||
repo = "bat";
|
repo = "bat";
|
||||||
rev = "d3feec47b16a8e99eabb34cdfbaa115541d374fc";
|
rev = "d3feec47b16a8e99eabb34cdfbaa115541d374fc";
|
||||||
sha256 = "sha256-s0CHTihXlBMCKmbBBb8dUhfgOOQu9PBCQ+uviy7o47w=";
|
sha256 = "sha256-s0CHTihXlBMCKmbBBb8dUhfgOOQu9PBCQ+uviy7o47w=";
|
||||||
};
|
};
|
||||||
file = "/themes/Catppuccin Mocha.tmTheme";
|
file = "/themes/Catppuccin Mocha.tmTheme";
|
||||||
};
|
};
|
||||||
@ -83,172 +90,6 @@
|
|||||||
settings = lib.importTOML confs/starship.toml;
|
settings = lib.importTOML confs/starship.toml;
|
||||||
};
|
};
|
||||||
|
|
||||||
# borgmatic
|
|
||||||
services.borgmatic = {
|
|
||||||
enable = true;
|
|
||||||
frequency = "daily";
|
|
||||||
};
|
|
||||||
programs.borgmatic = {
|
|
||||||
enable = true;
|
|
||||||
backups.epool = {
|
|
||||||
location = {
|
|
||||||
repositories = [ "/epool/borgbackup/moonshadow" ];
|
|
||||||
patterns = [
|
|
||||||
"+ /home/jas"
|
|
||||||
"- /home/jas/.cache"
|
|
||||||
"- /home/jas/downloads"
|
|
||||||
"- /home/jas/.local/share/containers"
|
|
||||||
"- /home/jas/.config/emacs"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
retention = {
|
|
||||||
keepDaily = 7;
|
|
||||||
keepMonthly = 12;
|
|
||||||
keepWeekly = 4;
|
|
||||||
keepYearly = 4;
|
|
||||||
};
|
|
||||||
consistency.checks = [
|
|
||||||
{
|
|
||||||
name = "repository";
|
|
||||||
frequency = "2 weeks";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "archives";
|
|
||||||
frequency = "4 weeks";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# zsh config
|
|
||||||
programs.zsh = {
|
|
||||||
enable = true;
|
|
||||||
enableCompletion = true;
|
|
||||||
autosuggestion.enable = true;
|
|
||||||
autocd = false;
|
|
||||||
envExtra = ''
|
|
||||||
export PATH="$HOME/bin:$HOME/.local/bin:/usr/sbin:$PATH"
|
|
||||||
'';
|
|
||||||
history = {
|
|
||||||
extended = true;
|
|
||||||
ignoreAllDups = false;
|
|
||||||
ignoreDups = true;
|
|
||||||
path = "${config.home.homeDirectory}/.zsh_history";
|
|
||||||
save = 65536;
|
|
||||||
share = false;
|
|
||||||
size = 100000;
|
|
||||||
};
|
|
||||||
historySubstringSearch.enable = true;
|
|
||||||
zplug.enable = true;
|
|
||||||
zplug.plugins = [
|
|
||||||
{
|
|
||||||
name = "zsh-users/zsh-syntax-highlighting";
|
|
||||||
tags = [ "defer:2" ];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "plugins/sudo";
|
|
||||||
tags = [ "from:oh-my-zsh" ];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "plugins/extract";
|
|
||||||
tags = [ "from:oh-my-zsh" ];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "plugins/systemd";
|
|
||||||
tags = [ "from:oh-my-zsh" ];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "${config.home.homeDirectory}/.zshrc.d";
|
|
||||||
tags = [ "from:local" "use:'*'" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
shellAliases = {
|
|
||||||
acs = "sudo apt-cache search $@";
|
|
||||||
acp = "sudo apt-cache policy $@";
|
|
||||||
afs = "sudo apt-file search $@";
|
|
||||||
afu = "sudo apt-file update";
|
|
||||||
agi = "sudo apt install $@";
|
|
||||||
agp = "sudo apt purge $@";
|
|
||||||
agr = "sudo apt remove $@";
|
|
||||||
agu = "sudo apt update";
|
|
||||||
agud = "sudo apt update && sudo apt dist-upgrade";
|
|
||||||
agar = "sudo apt autoremove";
|
|
||||||
ls = "eza --git --icons $@";
|
|
||||||
la = "eza --git --icons -a $@";
|
|
||||||
lal = "eza --git --icons -al $@";
|
|
||||||
ll = "eza --git --icons -l $@";
|
|
||||||
grep = "rg $@";
|
|
||||||
df = "duf $@";
|
|
||||||
cp = "cp -i $@";
|
|
||||||
rm = "trash $@";
|
|
||||||
del = "/bin/rm -i $@";
|
|
||||||
mv = "mv -i $@";
|
|
||||||
zfun = "functions | bat -l zsh";
|
|
||||||
pubip4 = "curl -s -m 5 ipv4.icanhazip.com";
|
|
||||||
pubip6 = "curl -s -m 5 ipv6.icanhazip.com";
|
|
||||||
netcons = "lsof -i";
|
|
||||||
tulp = "ss -tulp";
|
|
||||||
openports = "sudo lsof -i | grep LISTEN";
|
|
||||||
pong = "ping -c 3 www.google.com";
|
|
||||||
lsock = "sudo lsof -i -P";
|
|
||||||
lsocku = "sudo lsof -nP | grep UDP";
|
|
||||||
lsockt = "sudo lsof -nP | grep TCP";
|
|
||||||
fw = "sudo firewall-cmd $@";
|
|
||||||
fwr = "sudo firewall-cmd --reload";
|
|
||||||
fwp = "sudo firewall-cmd --permanent $@";
|
|
||||||
ga = "git add $@";
|
|
||||||
gcl = "git clone $@";
|
|
||||||
gcmsg = "git commit -m $@";
|
|
||||||
gd = "git diff";
|
|
||||||
gp = "git push $@";
|
|
||||||
grm = "git rm $@";
|
|
||||||
grv = "git remote -v";
|
|
||||||
gst = "git status";
|
|
||||||
doomdoc = "\${xdg.configHome}/emacs/bin/doom doctor";
|
|
||||||
dsync = "\${xdg.configHome}/emacs/bin/doom sync";
|
|
||||||
dclean = "\${xdg.configHome}/emacs/bin/doom clean";
|
|
||||||
dgc = "\${xdg.configHome}/emacs/bin/doom gc";
|
|
||||||
dupgrade = "\${xdg.configHome}/emacs/bin/doom upgrade";
|
|
||||||
pubkey = "cat ${config.home.homeDirectory}/.ssh/id_ed25519.pub | tr -d '\n' | wl-copy";
|
|
||||||
};
|
|
||||||
shellGlobalAliases = {
|
|
||||||
G = "| grep";
|
|
||||||
J = "| jq";
|
|
||||||
CC = "| wl-copy";
|
|
||||||
H = "| head";
|
|
||||||
T = "| tail";
|
|
||||||
L = "| less -RFX";
|
|
||||||
C = "| wc -l";
|
|
||||||
B = "| bat";
|
|
||||||
};
|
|
||||||
sessionVariables = {
|
|
||||||
PAGER = "less -RFX";
|
|
||||||
MANWIDTH = "88";
|
|
||||||
MANROFFOPT = "-c";
|
|
||||||
MANPAGER = "less -RFX";
|
|
||||||
EDITOR = "emacsclient";
|
|
||||||
GROFF_NO_SGR = 1;
|
|
||||||
BAT_PAGER = "less -RFX";
|
|
||||||
BAT_STYLE = "plain";
|
|
||||||
};
|
|
||||||
initExtraFirst = ''
|
|
||||||
export LS_COLORS=$(vivid generate catppuccin-mocha)
|
|
||||||
export LESS_TERMCAP_mb=$'\e[1;31m'
|
|
||||||
export LESS_TERMCAP_md=$'\e[1;34m'
|
|
||||||
export LESS_TERMCAP_so=$'\e[01;0;33m'
|
|
||||||
export LESS_TERMCAP_us=$'\e[01;31m'
|
|
||||||
export LESS_TERMCAP_me=$'\e[0m'
|
|
||||||
export LESS_TERMCAP_se=$'\e[0m'
|
|
||||||
export LESS_TERMCAP_ue=$'\e[0m'
|
|
||||||
if test -x ${config.home.homeDirectory}/bin/gumssh; then bindkey -s '^[s' 'gumssh^M'; fi
|
|
||||||
bindkey -s '^[f' 'yazi^M'
|
|
||||||
'';
|
|
||||||
initExtra = ''
|
|
||||||
eval "$(direnv hook zsh)"
|
|
||||||
eval "$(starship init zsh)"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# neovim
|
# neovim
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user