Updated dotfiles

This commit is contained in:
rpriven 2025-06-06 16:24:02 -06:00
parent 1c5353187b
commit 64889e9013
4 changed files with 94 additions and 58 deletions

View file

@ -434,7 +434,7 @@ tmux_conf_urlscan_options="--compact --dedupe"
# this is the place to override or undo settings # this is the place to override or undo settings
# increase history size # increase history size
#set -g history-limit 10000 #set -g history-limit 999999
# start with mouse mode enabled # start with mouse mode enabled
#set -g mouse on #set -g mouse on

View file

@ -18,6 +18,15 @@ yt() {
fabric -y "$video_link" $transcript_flag fabric -y "$video_link" $transcript_flag
} }
for pattern_file in $HOME/.config/fabric/patterns/*; do
# Get the base name of the file (i.e., remove the directory path)
pattern_name=$(basename "$pattern_file")
# Create an alias in the form: alias pattern_name="fabric --pattern pattern_name"
alias_command="alias $pattern_name='fabric --pattern $pattern_name'"
# Evaluate the alias command to add it to the current shell
eval "$alias_command"
done
# TMUX-RECON Aliases # TMUX-RECON Aliases
# ---------------------------- # ----------------------------
@ -52,6 +61,7 @@ alias k='kill $(ps aux | fzf | awk '\''{print $2}'\'')'
# alias k9='kill -9 **' # alias k9='kill -9 **'
alias nf='fzf -m --preview="bat --color=always --style=numbers --line-range:300 {}" --bind "enter:become(hx {+})"' alias nf='fzf -m --preview="bat --color=always --style=numbers --line-range:300 {}" --bind "enter:become(hx {+})"'
alias p='parallel' alias p='parallel'
alias rm='rm -I'
if [[ -n "$ZSH_VERSION" ]]; then if [[ -n "$ZSH_VERSION" ]]; then
alias s='source ~/.zshrc; source ~/.aliases' alias s='source ~/.zshrc; source ~/.aliases'
@ -90,7 +100,7 @@ function take {
alias batclip='bat $1 | xclip' alias batclip='bat $1 | xclip'
alias du='dust' alias du='dust'
alias df='duf' alias dfh='gdu -dn'
alias dl='yt-dlp -f best $1' alias dl='yt-dlp -f best $1'
if [[ -n "$ZSH_VERSION" ]]; then if [[ -n "$ZSH_VERSION" ]]; then
@ -229,7 +239,13 @@ alias serve='python3 -m http.server 80'
alias xh='xh --style auto' alias xh='xh --style auto'
alias myip='curl ifconfig.me' alias myip='curl ifconfig.me'
alias localip="ip a | grep inet" alias localip="ip a | grep inet"
alias ping='gping'
if command -v mtr &> /dev/null; then
alias ping='mtr'
else
unalias ping
fi
alias net='bandwhich' alias net='bandwhich'
alias sniff='sudo tcpdump -i any -n' alias sniff='sudo tcpdump -i any -n'
alias ports='ss -tuln' alias ports='ss -tuln'
@ -246,3 +262,11 @@ alias gco='git checkout'
alias ga='git add' alias ga='git add'
alias gst='git rev-parse --git-dir > /dev/null 2>&1 && git status || eza' alias gst='git rev-parse --git-dir > /dev/null 2>&1 && git status || eza'
copy-line() {
rg --line-number . | fzf --delimiter ':' --preview 'bat --color=always --highlight-line {2} {1}' | awk -F ':' '{print "+"$2" "$1}'
}
open-at-line() {
hx $(rg --line-number . | fzf --delimiter ':' --preview 'bat --color=always --highlight-line {2} {1}' | awk -F ':' '{print "+"$2" "$1}')
}

View file

@ -6,6 +6,30 @@ export LANG=en_US.UTF-8 # avoid locale issues
export LC_ALL=en_US.UTF-8 export LC_ALL=en_US.UTF-8
export GOROOT="/usr/local/go" export GOROOT="/usr/local/go"
export GOPATH="$HOME/go" export GOPATH="$HOME/go"
export PATH=$PATH:$GOROOT/bin
# --- fzf ---
# export FZF_DEFAULT_COMMAND='find . -type f' \
# fzf --bind 'ctrl-d:reload(find . -type d),ctrl-f:reload(eval "$FZF_DEFAULT_COMMAND")' \
# --height=50% --layout=reverse
# Preview file content using bat (https://github.com/sharkdp/bat)
# export FZF_CTRL_T_OPTS="
# --walker-skip .git,node_modules,target
# --preview 'bat -n --color=always {}'
# --bind 'ctrl-/:change-preview-window(down|hidden|)'"
# CTRL-Y to copy the command into clipboard using pbcopy
# export FZF_CTRL_R_OPTS="
# --bind 'ctrl-y:execute-silent(echo -n {2..} | pbcopy)+abort'
# --color header:italic
# --header 'Press CTRL-Y to copy command into clipboard'"
# Print tree structure in the preview window
# export FZF_ALT_C_OPTS="
# --walker-skip .git,node_modules,target
# --preview 'tree -C {}'"
# Path # Path
export PATH="$PATH:$HOME/go/bin" export PATH="$PATH:$HOME/go/bin"
@ -13,11 +37,12 @@ export PATH="$PATH:$HOME/.scripts"
export PATH="$PATH:$HOME/.cargo/bin" export PATH="$PATH:$HOME/.cargo/bin"
export PATH="$PATH:$GOPATH/bin:$GOROOT/bin" export PATH="$PATH:$GOPATH/bin:$GOROOT/bin"
export PATH="$PATH:/usr/local/go/bin" export PATH="$PATH:/usr/local/go/bin"
export PATH="$PATH:/go/bin"
export PATH="$PATH:$HOME/.local/bin" export PATH="$PATH:$HOME/.local/bin"
#export PATH="$PATH:$HOME/miniconda3/bin" #export PATH="$PATH:$HOME/miniconda3/bin"
# clean path: # clean path:
# export PATH=$(echo "$PATH" | tr ':' '\n' | awk '!seen[$0]++' | paste -sd:) export PATH=$(echo "$PATH" | tr ':' '\n' | awk '!seen[$0]++' | paste -sd:)
# PY3="python3 -c 'import pty;pty.spawn(\"bin/bash\")'" # PY3="python3 -c 'import pty;pty.spawn(\"bin/bash\")'"
# SHELLEXPORTS="export TERM=xterm;stty rows $(tput lines) columns $(tput cols)" # SHELLEXPORTS="export TERM=xterm;stty rows $(tput lines) columns $(tput cols)"

View file

@ -5,56 +5,61 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi fi
if [[ -f "/opt/homebrew/bin/brew" ]] then if [[ -f "/opt/homebrew/bin/brew" ]]; then
# If you're using macOS, you'll want this enabled # If you're using macOS, you'll want this enabled
eval "$(/opt/homebrew/bin/brew shellenv)" eval "$(/opt/homebrew/bin/brew shellenv)"
fi fi
# Set the directory we want to store zinit and plugins # Kill conflicting alias if it exists
unalias z 2>/dev/null
unalias zi 2>/dev/null unalias zi 2>/dev/null
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
# Download Zinit, if it's not there yet # Clone zcomet if necessary
if [ ! -d "$ZINIT_HOME" ]; then if [[ ! -f ${ZDOTDIR:-${HOME}}/.zcomet/bin/zcomet.zsh ]]; then
mkdir -p "$(dirname $ZINIT_HOME)" command git clone https://github.com/agkozak/zcomet.git ${ZDOTDIR:-${HOME}}/.zcomet/bin
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
fi fi
# Source/Load zinit source ${ZDOTDIR:-${HOME}}/.zcomet/bin/zcomet.zsh
source "${ZINIT_HOME}/zinit.zsh"
# Add in Powerlevel10k # Load a code snippet - no need to download an entire repository
zinit ice depth=1; zinit light romkatv/powerlevel10k zcomet snippet https://github.com/jreese/zsh-titles/blob/master/titles.plugin.zsh
# Add in zsh plugins # Lazy-load Prezto's archive module without downloading all of Prezto's
zinit light zsh-users/zsh-syntax-highlighting # submodules
zinit light zsh-users/zsh-completions zcomet trigger --no-submodules archive unarchive lsarchive \
zinit light zsh-users/zsh-autosuggestions sorin-ionescu/prezto modules/archive
zinit light Aloxaf/fzf-tab
# Add in snippets
zinit snippet OMZL::git.zsh
zinit snippet OMZP::git
zinit snippet OMZP::sudo
zinit snippet OMZP::archlinux
zinit snippet OMZP::aws
zinit snippet OMZP::kubectl
zinit snippet OMZP::kubectx
zinit snippet OMZP::command-not-found
# Run compinit and compile its cache
zcomet compinit
# Load completions # Load completions
autoload -Uz compinit && compinit # autoload -Uz compinit && compinit
zinit cdreplay -q # Themes and UI
zcomet load romkatv/powerlevel10k
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. # Completions and plugins
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh zcomet load zsh-users/zsh-syntax-highlighting
zcomet load zsh-users/zsh-completions
zcomet load zsh-users/zsh-autosuggestions
zcomet load Aloxaf/fzf-tab
# Oh My Zsh snippets
# zcomet load ohmyzsh/ohmyzsh lib/git.zsh
# zcomet load ohmyzsh/ohmyzsh plugins/git
# zcomet load ohmyzsh/ohmyzsh plugins/sudo
# zcomet load ohmyzsh/ohmyzsh plugins/archlinux
# zcomet load ohmyzsh/ohmyzsh plugins/aws
# zcomet load ohmyzsh/ohmyzsh plugins/kubectl
# zcomet load ohmyzsh/ohmyzsh plugins/kubectx
# zcomet load ohmyzsh/ohmyzsh plugins/command-not-found
# Keybindings # Keybindings
bindkey -e bindkey -e
bindkey '^p' history-search-backward bindkey '^p' history-search-backward
bindkey '^n' history-search-forward bindkey '^n' history-search-forward
bindkey '^[w' kill-region bindkey '^[w' kill-region
bindkey "^[[1;5C" forward-word # Ctrl+Right
bindkey "^[[1;5D" backward-word # Ctrl+Left
# History # History
HISTSIZE=99999 HISTSIZE=99999
@ -62,7 +67,7 @@ HISTFILE=~/.zsh_history
SAVEHIST=$HISTSIZE SAVEHIST=$HISTSIZE
HISTDUP=erase HISTDUP=erase
setopt appendhistory setopt appendhistory
setopt sharehistory # setopt sharehistory
setopt hist_ignore_space setopt hist_ignore_space
setopt hist_ignore_all_dups setopt hist_ignore_all_dups
setopt hist_save_no_dups setopt hist_save_no_dups
@ -76,11 +81,6 @@ zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath' zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath' zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
# Aliases
alias ls='ls --color'
alias vim='nvim'
alias c='clear'
# Shell integrations # Shell integrations
# eval "$(fzf --zsh)" # eval "$(fzf --zsh)"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
@ -91,24 +91,7 @@ source $HOME/.cargo/env
[ -f ~/.aliases ] && source ~/.aliases [ -f ~/.aliases ] && source ~/.aliases
[ -f ~/.exports ] && source ~/.exports [ -f ~/.exports ] && source ~/.exports
[ -f ~/.p10k.zsh ] && source ~/.p10k.zsh [ -f ~/.p10k.zsh ] && source ~/.p10k.zsh
# unalias zi source /usr/share/doc/pkgfile/command-not-found.zsh
# Fix Ctrl+Arrow Keys in zsh
bindkey "^[[1;5C" forward-word # Ctrl+Right
bindkey "^[[1;5D" backward-word # Ctrl+Left
# for pattern_file in $HOME/.config/fabric/patterns/*; do
# # Get the base name of the file (i.e., remove the directory path)
# pattern_name=$(basename "$pattern_file")
# # Create an alias in the form: alias pattern_name="fabric --pattern pattern_name"
# alias_command="alias $pattern_name='fabric --pattern $pattern_name'"
# # Evaluate the alias command to add it to the current shell
# eval "$alias_command"
# done
source ~/.zshenv
# >>> conda initialize >>> # >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !! # !! Contents within this block are managed by 'conda init' !!
@ -125,3 +108,7 @@ fi
unset __conda_setup unset __conda_setup
# <<< conda initialize <<< # <<< conda initialize <<<
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion