diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c962d6e --- /dev/null +++ b/.gitignore @@ -0,0 +1,60 @@ +# API Keys and Secrets (MOST IMPORTANT) +opencode/.config/opencode/.mcp.json +opencode/* +**/REDACTED* +**/*secret* +**/*key* +**/*token* +**/*auth* +**/*password* + +# Personal/Machine-specific Files +ulauncher/.config/ulauncher/ext_preferences/*.db +**/*.bak +**/*.backup + +# Cache and Temporary Files +**/.cache/ +**/cache/ +**/*.log +**/*.tmp +**/*.temp + +# Git hooks (contain samples) +.git/hooks/ + +# OS and Editor Files +.DS_Store +.vscode/ +.idea/ +**/*~ +**/*.swp +**/*.swo + +# Personal History Files +**/*history* + +# Email privacy (git config) +**/user.email* +**/*@* + +# Runtime and state files +**/*.pid +**/*.state +**/node_modules/ +**/.env* + +# Espanso - text expansion (may contain passwords, API keys, personal snippets) +espanso/ +.config/espanso/ + +# OpenCode - personal AI setup (may contain sensitive prompts/configs) +opencode/ +.config/opencode/ + +# Prismus +prismis/ +.config/prismis/ + +# Git config (contains personal email/name) +git/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..f7746e9 --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# Dotfiles Repository + +This repository contains a collection of +configuration files for various tools and +applications. These dotfiles can be easily deployed +using GNU Stow for managing symbolic links to the +configuration files. + +## Usage + +### Deploying Dotfiles with GNU Stow + +1. Clone the repository to your local machine: + ```bash + git clone + +2. Navigate to the cloned repository: +cd dotfiles + +3. Use GNU Stow to deploy specific configuration +files. For example, to deploy the Bash configuration: +stow bash + +4. Repeat the stow command for each tool or +application you want to deploy configurations for. + +### Additional Instructions + +• Ensure that GNU Stow is installed on your system +before deploying the dotfiles. +• Customize the configurations as needed before +deploying them. +• Make sure to back up any existing configuration +files that might be overwritten during deployment. + +## Tools Included + +• Alacritty +• Bash +• Bat +• Espanso +• Git +• Helix +• Omp +• Procs +• Tmux +• Ulauncher +• Yazi +• Zsh diff --git a/espanso/.config/espanso/match/base.yml b/espanso/.config/espanso/match/base.yml deleted file mode 100644 index b7443ec..0000000 --- a/espanso/.config/espanso/match/base.yml +++ /dev/null @@ -1,175 +0,0 @@ -# espanso match file - -# For a complete introduction, visit the official docs at: https://espanso.org/docs/ - -# You can use this file to define the base matches (aka snippets) -# that will be available in every application when using espanso. - -# Matches are substitution rules: when you type the "trigger" string -# it gets replaced by the "replace" string. - -# yaml-language-server: $schema=https://raw.githubusercontent.com/espanso/espanso/dev/schemas/match.schema.json - -matches: - # Simple text replacement - - trigger: ":espanso" - replace: "Hi there!" - - # NOTE: espanso uses YAML to define matches, so pay attention to the indentation! - - # But matches can also be dynamic: - - # Print the current date - - trigger: ":date" - replace: "{{mydate}}" - vars: - - name: mydate - type: date - params: - format: "%m/%d/%Y" - - - trigger: ":dt" - replace: "{{date}} {{time}}" - vars: - - name: date - type: date - params: - format: "%m/%d/%Y" - - name: time - type: time - params: - format: "%H:%M:%S" - - # Print the output of a shell command - - trigger: ":shell" - replace: "{{output}}" - vars: - - name: output - type: shell - params: - cmd: "echo 'Hello from your shell'" - - - trigger: :trigger - replace: | - - trigger: test - replace: test - - - trigger: :test - replace: > - This is an example - of how to use a multi- - line example of :test - - - trigger: ":easy" - replace: "This is easy!" - - - trigger: :sno - replace: | - # Title - - - ## Installation - /code - - ## Usage - /code - - ## Resources - - - trigger: :tfi - replace: | - --- - solved: - bonus_flag: - flag: - link: - --- - - We find the link in Chapter 4 of the comic: - - https://tficomic.io/ - - We visit the link (which expands to: ) and we get the bonus flag: - - ``` - - ``` - - And the real challenge is: - - " - - " - - - - And we get the flag: - - ``` - - ``` - - - trigger: :meat - replace: 🥩 - search_terms: - - steak - - t-bone - - - regex: ";no.spons\\((?P.*)\\)" - replace: | - Hi there, - Thanks for reaching out! However, I don't believe {{product}} is a good fit for my audience at this point, and my ethics statement (https://nicolevanderhoeven.com/ethics/), as well as my limited time, prohibits me from accpting most opportunities. I hope you understand! - - I wish you the best of luck in finding someone who is a better fit. - - Thank you, - Nicole - - - trigger: ":uuid" - replace: "{{uuid}}" - vars: - - name: uuid - type: shell - params: - cmd: "uuidgen" - - - trigger: ":now" - replace: "{{now}}" - vars: - - name: now - type: date - params: - format: "%Y-%m-%d %H:%M" - - - trigger: ":clip-clean" - replace: "{{clip | replace('\n', ' ')}}" - vars: - - name: clip - type: shell - params: - cmd: "xclip -o -selection clipboard" - - - trigger: ":randnum" - replace: "{{rand}}" - vars: - - name: rand - type: shell - params: - cmd: "shuf -i 1000-9999 -n 1" - - - trigger: ":logentry" - replace: | - ## Log - :now - **What happened:** - - - **Next actions:** - - - - vars: - - name: now - type: date - params: - format: "%Y-%m-%d %H:%M" - - - # And much more! For more information, visit the docs: https://espanso.org/docs/ diff --git a/git/.gitconfig b/git/.gitconfig deleted file mode 100644 index 5f9303f..0000000 --- a/git/.gitconfig +++ /dev/null @@ -1,11 +0,0 @@ -[user] - name = rpriven - email = rob.pratt@tutanota.com -[init] - defaultBranch = main - -[core] - editor = nvim -[alias] - co = checkout - lg = log --all --graph --format=oneline diff --git a/zsh/.aliases b/zsh/.aliases index 66810a6..ae805b2 100644 --- a/zsh/.aliases +++ b/zsh/.aliases @@ -1,16 +1,19 @@ # ~/dotfiles/aliases.sh +# ---- PAI Commands ----- +alias cmd='bun ~/.claude/commands/cmd.ts' + # ---- Fabric ----- yt() { - if [ "$#" -eq 0 ] || [ "$#" -gt 2 ]; then - echo "Usage: yt [-t | --timestamps] youtube-link" + if [[ "$#" -eq 0 ]] || [[ "$#" -gt 2 ]]; then + echo "Usage: yt [[-t | --timestamps]] youtube-link" echo "Use the '-t' flag to get the transcript with timestamps." return 1 fi transcript_flag="--transcript" - if [ "$1" = "-t" ] || [ "$1" = "--timestamps" ]; then + if [[ "$1" = "-t" ]] || [[ "$1" = "--timestamps" ]]; then transcript_flag="--transcript-with-timestamps" shift fi @@ -18,7 +21,7 @@ yt() { fabric -y "$video_link" $transcript_flag } -for pattern_file in $HOME/.config/fabric/patterns/*; do +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" @@ -27,6 +30,48 @@ for pattern_file in $HOME/.config/fabric/patterns/*; do eval "$alias_command" done +# --- OpenCode --- + +ide() { + local project="${1:-$(pwd)}" # directory to open, pwd if not specified + local editor="${2:-hx}" # default helix + local win_name="ide" + + if [[ -n "$TMUX" ]]; then + tmux new-window -n "$win_name" -c "$project" + + # Left pane: opencode + tmux select-pane -t 0 + tmux send-keys "opencode" C-m + + # Split right: right side gets 75%, left remains 25% + tmux split-window -h -p 75 -c "$project" # pane 1 (right) + tmux send-keys "$editor \"$project\"" C-m + + # Now on right side, split horizontally for bottom editor (~25%) + tmux select-pane -t 1 + + # Bottom-right: editor + tmux select-pane -t 2 + tmux split-window -v -p 25 -c "$project" # pane 2 (bottom-right) + + # Focus back on top-right (main terminal) + tmux select-pane -t 1 + else + tmux new-session -s "$win_name" -n main -d -c "$project" + tmux split-window -h -p 75 -c "$project" + tmux select-pane -t 0 + tmux send-keys "opencode" C-m + tmux select-pane -t 1 + tmux split-window -v -p 25 -c "$project" + tmux select-pane -t 2 + tmux send-keys "$editor \"$project\"" C-m + tmux select-pane -t 1 + tmux attach -t "$win_name" + fi +} + + # TMUX-RECON Aliases # ---------------------------- @@ -49,12 +94,16 @@ fi alias a='~/arsenal/run -t' alias any='~/AnythingLLMDesktop/start' alias c='clear' +cpy() { + cat "$1" | pbcopy +} alias d='docker' alias dc='docker-compose' # alias h='history' -f() { - fd $1 -exec bat {} + -} +alias f='fabric' +#f() { +# fd "$1" -exec bat {} + +#} alias i='sudo apt install' alias j='journalctl -f' alias jj='pbpaste | jsonpp | pbcopy' @@ -62,7 +111,11 @@ alias jjj='pbpaste | jsonpp' 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(hx {+})"' +alias oc='opencode' alias p='parallel' + +alias rec='parecord --device=alsa_output.pci-0000_00_1f.3.analog-stereo.monitor \ + --file-format=wav ~/recordings/meeting-$(date +%Y%m%d-%H%M%S).wav' alias rm='rm -I' if [[ -n "$ZSH_VERSION" ]]; then @@ -75,7 +128,7 @@ alias ta='tmux attach -t' alias trim="awk '{\$1=\$1;print}'" alias up='sudo apt update && sudo apt upgrade -y' alias v='fd --type f --hidden --exclude .git | fzf-tmux -p --reverse | xargs hx' -alias vp='fd --type f --hidden --exclude .git | fzf --preview "bat {1} --color=always --style=numbers" | xargs hx' +alias vp='fd --type f --hidden --exclude .git | fzf --preview "bat {} --color=always --style=numbers" | xargs hx' alias vv='hx $(fzf --preview="bat {} --color=always")' alias gr='glow $(fzf --preview="bat {} --color=always")' alias xx='exit' @@ -93,18 +146,26 @@ alias yy='yazi' # alias cdi='zoxide query -i' function take { - mkdir -p $1 - cd $1 + mkdir -p "$1" + cd "$1" || exit } # ---------------------------- # File & Disk Utilities # ---------------------------- -alias batclip='bat $1 | xclip' +# Unalias potential conflicts +unalias batclip 2>/dev/null +unalias dl 2>/dev/null + +batclip() { + bat "$1" | xclip +} alias du='dust' alias dfh='gdu -dn' -alias dl='yt-dlp -f best $1' +dl() { + yt-dlp -f best "$1" +} if [[ -n "$ZSH_VERSION" ]]; then alias reload='source ~/.zshrc' @@ -114,7 +175,7 @@ fi tailb() { - tail -f $1 | bat --paging=never -l log + tail -f "$1" | bat --paging=never -l log } @@ -126,7 +187,7 @@ tailb() { # 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 ff='find * -type f | fzf --preview "bat --color=always {}"' # alias fd='fdfind' # Debian compatibility # Press F1 to open the file with less without leaving fzf @@ -139,9 +200,9 @@ alias psf="ps -ef | --height=50% --layout=reverse" # List all commands or search through them -if [ -n "$ZSH_VERSION" ]; then - alias findcmd='command -v | fzf --prompt="Search command: "' -elif [ -n "$BASH_VERSION" ]; then +if [[ -n "$ZSH_VERSION" ]]; then + alias findcmd='print -l ${(k)commands} | fzf --prompt="Search command: "' +elif [[ -n "$BASH_VERSION" ]]; then alias findcmd='compgen -c | sort -u | fzf --prompt="Search command: "' fi @@ -166,9 +227,9 @@ alias tb='task burndown.daily' # ---------------------------- note() { - echo "date: $(date)" >> $HOME/drafts.txt - echo "$@" >> $HOME/drafts.txt - echo "" >> $HOME/drafts.txt + echo "date: $(date)" >> "$HOME"/drafts.txt + echo "$@" >> "$HOME"/drafts.txt + echo "" >> "$HOME"/drafts.txt } help() { @@ -179,6 +240,11 @@ help() { fi } +mdstrip() { + sed -i 's/\\n/\n/g' "$1" +} + + # help() { # "$@" --help 2>&1 | bat --plain --language=txt # } @@ -228,18 +294,19 @@ fi if command -v rg &> /dev/null; then alias rg='rg --smart-case' - alias rgl='rg --files | fzf' + alias rgl='rg --files | fzf --preview "bat --color=always {}"' fi if command -v ag &> /dev/null; then alias ags='ag --smart-case' - alias agf='ag -l | fzf' + alias agf='ag -l | fzf --preview "bat --color=always {}"' fi +# Smart history with atuin (fallback to fzf if not available) if command -v atuin &> /dev/null; then - alias h='atuin' + alias h='atuin search --interactive' else - alias h='history | fzf' + alias h='history | fzf --preview "echo {}" --preview-window="up:3:wrap"' fi # Python as 'py' and pip @@ -285,3 +352,49 @@ copy-line() { open-at-line() { hx $(rg --line-number . | fzf --delimiter ':' --preview 'bat --color=always --highlight-line {2} {1}' | awk -F ':' '{print "+"$2" "$1}') } + +# PAI Context Manager +alias cm="~/.claude/commands/context-manager.sh" +alias cms="~/.claude/commands/context-manager.sh search" +alias cmr="~/.claude/commands/context-manager.sh recent" +alias cmn="~/.claude/commands/context-manager.sh new" +alias cmt="~/.claude/commands/context-manager.sh tree" + +# Enhanced fzf file operations with better previews +alias fzfg='rg --line-number --color=always . | fzf --ansi --delimiter ":" --preview "bat --color=always --highlight-line {2} {1}" --bind "enter:execute(hx +{2} {1})"' +alias fzfd='fd --type d | fzf --preview "eza --tree --level=2 --color=always {} 2>/dev/null || tree -L 2 -C {}"' + +# Better process management +alias psg='ps aux | fzf --header-lines=1 --preview "echo {}" --preview-window=up:1' + +# Enhanced git fzf integration +alias gfzf='git log --oneline --color=always | fzf --ansi --preview "git show --color=always {1}" --bind "enter:execute(git show {1} | less -R)"' + +# -------------------------------------- +# N8N API Helper +# -------------------------------------- +# Requires N8N_API_KEY and N8N_BASE_URL in ~/.env +n8n_api() { + source ~/.env + local endpoint="${1:-/workflows}" + shift + curl -s -H "X-N8N-API-KEY: ${N8N_API_KEY}" \ + "${N8N_BASE_URL}/api/v1${endpoint}" \ + "$@" +} + +# -------------------------------------- +# Baserow API Helper +# -------------------------------------- +# Requires BASEROW_API_KEY and BASEROW_TABLE_ID in ~/.env +# Baserow is on localhost:3000 via SSH tunnel +baserow_api() { + source ~/.env + local endpoint="${1:-database/rows/table/${BASEROW_CONTACTS_TABLE_ID}/}" + if [ $# -gt 0 ]; then + shift + fi + curl -s -H "Authorization: Token ${BASEROW_API_KEY}" \ + "http://baserow:3000/api/${endpoint}" \ + "$@" +} diff --git a/zsh/.exports b/zsh/.exports index 0c5b24c..95ec078 100644 --- a/zsh/.exports +++ b/zsh/.exports @@ -1,28 +1,36 @@ # .exports dotfile export EDITOR="${EDITOR:-hx}" export PAGER="${PAGER:-most}" + +# PAI3 Personal AI Infrastructure +export PAI_HOME="/home/e" +export PATH=$PATH:"$HOME/.claude" +export PATH=$PATH:"$HOME/.claude/commands" +# export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\[[0-9;]*m//g; s/.\\x08//g\" | bat -p -lman'"\nman 2 select export BROWSER="${BROWSER:-brave}" export LANG=en_US.UTF-8 # avoid locale issues export LC_ALL=en_US.UTF-8 export GOROOT="/usr/local/go" export GOPATH="$HOME/go" export PATH=$PATH:$GOROOT/bin +# export STOW_DIR="$HOME/.config" # --- 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 +# Optimized fzf settings +export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git' +export FZF_DEFAULT_OPTS='--height 60% --layout=reverse --border --inline-info --preview-window=right:60%' -# 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|)'" +# Better file search with bat preview +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 +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 to clipboard'" # --header 'Press CTRL-Y to copy command into clipboard'" # Print tree structure in the preview window diff --git a/zsh/.zshrc b/zsh/.zshrc index b2373f2..92e0015 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -4,6 +4,10 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +# source ~/powerlevel10k/powerlevel10k.zsh-theme +# Instant prompt = Quiet +POWERLEVEL9K_INSTANT_PROMPT=quiet if [[ -f "/opt/homebrew/bin/brew" ]]; then # If you're using macOS, you'll want this enabled @@ -78,20 +82,30 @@ setopt hist_find_no_dups zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" zstyle ':completion:*' menu no -zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath' -zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath' +# Enhanced fzf-tab completions with better previews +zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -la --color=always $realpath 2>/dev/null || ls --color=always $realpath' +zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'eza -la --color=always $realpath 2>/dev/null || ls --color=always $realpath' + +# Preview for other common commands +zstyle ':fzf-tab:complete:cat:*' fzf-preview 'bat --color=always $realpath 2>/dev/null || cat $realpath' +zstyle ':fzf-tab:complete:bat:*' fzf-preview 'bat --color=always $realpath' +zstyle ':fzf-tab:complete:less:*' fzf-preview 'bat --color=always $realpath 2>/dev/null || cat $realpath' +zstyle ':fzf-tab:complete:more:*' fzf-preview 'bat --color=always $realpath 2>/dev/null || cat $realpath' # Shell integrations # eval "$(fzf --zsh)" [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh eval "$(zoxide init zsh)" +# Atuin setup - smart history search +eval "$(atuin init zsh)" + # Sourcing source $HOME/.cargo/env [ -f ~/.aliases ] && source ~/.aliases [ -f ~/.exports ] && source ~/.exports -[ -f ~/.p10k.zsh ] && source ~/.p10k.zsh -source /usr/share/doc/pkgfile/command-not-found.zsh +# source /usr/share/doc/pkgfile/command-not-found.zsh +# source /usr/lib/command-not-found # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! @@ -112,3 +126,18 @@ source /usr/share/doc/pkgfile/command-not-found.zsh 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 + + +# Generated for pdtm. Do not edit. +export PATH=$PATH:/home/e/.pdtm/go/bin + + +# opencode +export PATH=/home/e/.opencode/bin:$PATH + +# bun completions +[ -s "/home/e/.bun/_bun" ] && source "/home/e/.bun/_bun" + +# bun +export BUN_INSTALL="$HOME/.bun" +export PATH="$BUN_INSTALL/bin:$PATH"