Initial dotfiles commit

This commit is contained in:
rpriven 2025-04-24 18:29:36 -06:00
commit ff31fd3bea
7 changed files with 1950 additions and 0 deletions

1
bash/.aliases Symbolic link
View file

@ -0,0 +1 @@
../zsh/.aliases

1
bash/.exports Symbolic link
View file

@ -0,0 +1 @@
../zsh/.exports

17
bash/bash.bash Normal file
View file

@ -0,0 +1,17 @@
# ---- TMUX-RECON bash.bash ----
# source custom aliases if exists
[ -f ~/.aliases.sh ] && source ~/.aliases.sh
# add .scripts to path
export PATH="$HOME/.scripts:$PATH"
# zoxide (if installed)
if command -v zoxide &> /dev/null; then
eval "$(zoxide init bash)"
fi
# fzf (if installed)
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
# Custom prompt options or PS1 here if desired

1720
p10k/.p10k.zsh Normal file

File diff suppressed because it is too large Load diff

175
zsh/.aliases Normal file
View file

@ -0,0 +1,175 @@
# ~/dotfiles/aliases.sh
# TMUX-RECON Aliases
# ----------------------------
# Clipboard (conditional on xsel or xclip)
# ----------------------------
if command -v xsel &> /dev/null; then
alias pbcopy='xsel --input --clipboard'
alias pbpaste='xsel --output --clipboard'
elif command -v xclip &> /dev/null; then
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
fi
# ----------------------------
# Basic Shortcuts
# ----------------------------
alias a='~/arsenal/run -t'
alias c='clear'
# alias h='history'
f() {
fd $1 -exec bat {} +
}
alias j='journalctl -f'
alias k='kill $(ps aux | fzf | awk '\''{print $2}'\'')'
# alias k9='kill -9 **'
alias nf='fzf -m --preview="bat --color=always --style=numbers --line-range:300 {}" --bind "enter:become(nvim {})"'
alias up='sudo apt update && sudo apt upgrade -y'
alias v='nvim $(fzf)'
alias xx='exit'
alias yy='yazi'
# --------------------------------------
# Navigation
# --------------------------------------
# alias ..='cd ..'
# alias ...='cd ../..'
alias cdf='cd $(fd -t d | fzf)'
# alias cd='z'
alias cdi='zoxide query -i'
# alias z='zoxide query -i'
# ----------------------------
# File & Disk Utilities
# ----------------------------
alias batclip='bat $1 | xclip'
alias du='dust'
alias df='duf'
alias dl='yt-dlp -f best $1'
if [[ -n "$ZSH_VERSION" ]]; then
alias reload='source ~/.zshrc'
elif [[ -n "$BASH_VERSION" ]]; then
alias reload='source ~/.bashrc'
fi
tailb() {
tail -f $1 | bat --paging=never -l log
}
# --------------------------------------
# Search / Fuzzy Finder
# --------------------------------------
# alias f='fd -H -I -t f'
# f() { cd "$(find . -type d | fzf)" }
alias fzf="fzf --preview 'bat --color=always {}'"
# alias fzf="fzf --height 40% --layout reverse --border --preview 'bat --color=always {}' --preview-window '~3'"
alias ff='find * -type f | fzf'
# alias fd='fdfind' # Debian compatibility
# Press F1 to open the file with less without leaving fzf
# Press CTRL-Y to copy the line to clipboard and aborts fzf (requires pbcopy)
alias fo="fzf --bind 'f1:execute(less -f {}),ctrl-y:execute-silent(echo {} | pbcopy)+abort'"
alias psf="ps -ef |
fzf --bind 'ctrl-r:reload(ps -ef)' \
--header 'Press CTRL-R to reload' --header-lines=1 \
--height=50% --layout=reverse"
# List all commands or search through them
alias findcmd='compgen -c | sort -u | fzf --prompt="Search command: "'
alias allcmds='compgen -c | sort -u | fzf'
# ----------------------------
# Miscellaneous
# ----------------------------
help() {
"$@" --help 2>&1 | bat --plain --language=help
}
alias shelp='builtin help | bat --plain --language=help'
# alias bathelp='bat --plain --language=help'
# help() {
# "$@" --help 2>&1 | bathelp
# }
# ----------------------------
# Conditional Fallbacks
# ----------------------------
# Debian-specific fix for fd
if ! command -v fd &> /dev/null && command -v fdfind &> /dev/null; then
alias fd='fdfind'
fi
# if command -v bat &> /dev/null; then
# alias cat="bat"
# elif command -v batcat &> /dev/null; then
# alias cat="batcat"
# fi
if command -v exa &> /dev/null; then
alias l='exa -l'
alias lsl='exa --icons'
alias ll='exa -al --icons'
alias lt='exa -al --tree --level=2 --icons'
elif command -v eza &> /dev/null; then
alias lg='eza -l --icons --git -a'
else
alias ls='ls --color=auto'
alias ll='ls -lah'
alias la='ls -A'
fi
if command -v rg &> /dev/null; then
alias rg='rg --smart-case'
alias rgl='rg --files | fzf'
fi
if command -v ag &> /dev/null; then
alias ags='ag --smart-case'
alias agf='ag -l | fzf'
fi
if command -v atuin &> /dev/null; then
alias h='atuin'
else
alias h='history | fzf'
fi
# Python as 'py' and pip
alias py='python3'
alias pip='python3 -m pip'
# --------------------------------------
# Networking & System Info
# --------------------------------------
alias xh='xh --style auto'
alias myip='curl ifconfig.me'
alias localip="ip a | grep inet"
alias ping='gping'
alias net='bandwhich'
alias sniff='sudo tcpdump -i any -n'
alias ports='ss -tuln'
alias psnet='sudo netstat -tulnp'
alias fire='sudo ufw status verbose'
alias logs='sudo tail -f /var/log/syslog'
alias chkports='sudo lsof -i -P -n | less'

8
zsh/.exports Normal file
View file

@ -0,0 +1,8 @@
# ~/dotfiles/env.sh
export EDITOR="${EDITOR:-vim}"
export PAGER="${PAGER:-most}"
export BROWSER="${BROWSER:-brave}"
if command -v bat &> /dev/null; then
export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\[[0-9;]*m//g; s/.\\x08//g\" | bat -p -lman'"
fi

28
zsh/zsh.zsh Normal file
View file

@ -0,0 +1,28 @@
# ---- TMUX-RECON zsh.zsh ----
# source custom aliases if exists
[ -f ~/.aliases.sh ] && source ~/.aliases.sh
# add .scripts to path
export PATH="$HOME/.scripts:$PATH"
# zoxide (if installed)
if command -v zoxide &> /dev/null; then
eval "$(zoxide init zsh)"
fi
# fzf (if installed)
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# starship (optional fancy prompt)
[ -f ~/.config/starship.toml ] && eval "$(starship init zsh)"
# cargo
source $HOME/.cargo/env
alias -g -- -h='-h 2>&1 | bat --language=help --style=plain'
alias -g -- --help='--help 2>&1 | bat --language=help --style=plain'
# Custom prompt options or PS1 here if desired
# You can add any shared settings, completions, etc.