Cleanup tasks.
This commit is contained in:
@@ -15,5 +15,8 @@ indent_size = 4
|
|||||||
[*.{yml,yaml}]
|
[*.{yml,yaml}]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
[Makefile]
|
[Makefile]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|||||||
52
.gitignore
vendored
52
.gitignore
vendored
@@ -1,27 +1,63 @@
|
|||||||
# OS files
|
# ============================================================================
|
||||||
|
# Dotfiles .gitignore
|
||||||
|
# ============================================================================
|
||||||
|
|
||||||
|
# --- OS files ---
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
# Backup files
|
# --- Backup files ---
|
||||||
*.backup
|
*.backup
|
||||||
*.bak
|
*.bak
|
||||||
*~
|
*~
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
|
||||||
# Local machine-specific configs
|
# --- Local machine-specific configs ---
|
||||||
*.local
|
*.local
|
||||||
.zshrc.local
|
.zshrc.local
|
||||||
|
.gitconfig.local
|
||||||
|
|
||||||
# Sensitive information
|
# --- Sensitive information ---
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
secrets/
|
secrets/
|
||||||
.git-credentials
|
.git-credentials
|
||||||
|
|
||||||
# Espanso backups
|
# --- Vault (encrypted secrets) ---
|
||||||
|
vault/
|
||||||
|
!vault/.gitkeep
|
||||||
|
|
||||||
|
# --- Espanso ---
|
||||||
espanso/match/*.backup
|
espanso/match/*.backup
|
||||||
|
|
||||||
# Editor files
|
# --- Editor/IDE files ---
|
||||||
*.swp
|
|
||||||
*.swo
|
|
||||||
.idea/
|
.idea/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
*.sublime-*
|
||||||
|
.project
|
||||||
|
.settings/
|
||||||
|
|
||||||
|
# --- Cache and temp files ---
|
||||||
|
.cache/
|
||||||
|
*.log
|
||||||
|
*.tmp
|
||||||
|
.sync_state
|
||||||
|
.sync_log
|
||||||
|
|
||||||
|
# --- Command tracking ---
|
||||||
|
.smart-suggest-track
|
||||||
|
|
||||||
|
# --- Bookmarks (machine-specific) ---
|
||||||
|
.bookmarks
|
||||||
|
|
||||||
|
# --- Generated files ---
|
||||||
|
dotfiles.conf.wizard
|
||||||
|
git/.gitconfig
|
||||||
|
|
||||||
|
# --- Package managers ---
|
||||||
|
node_modules/
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
.npm/
|
||||||
|
|||||||
122
CHANGELOG.md
Normal file
122
CHANGELOG.md
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this dotfiles project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.0.0] - 2025-12-15
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
#### Core Features
|
||||||
|
- **Interactive Setup Wizard** (`setup-wizard.sh`) - Beautiful TUI installer using `gum` with fallback to basic prompts
|
||||||
|
- **Command Palette** (`command-palette.zsh`) - Raycast-style fuzzy launcher triggered by Ctrl+Space or Ctrl+P
|
||||||
|
- **Smart Suggestions** (`smart-suggest.zsh`) - Typo correction for 100+ common mistakes + alias recommendations
|
||||||
|
- **Shell Analytics** (`shell-stats.sh`) - Dashboard showing command usage, suggestions, and activity heatmap
|
||||||
|
- **Secrets Vault** (`vault.sh`) - Encrypted storage for API keys using age/gpg
|
||||||
|
- **Dotfiles Sync** (`dotfiles-sync.sh`) - Multi-machine synchronization with watch mode
|
||||||
|
- **Dotfiles Doctor** (`dotfiles-doctor.sh`) - Health checker with auto-fix capability
|
||||||
|
- **Version Tracking** (`dotfiles-version.sh`) - Compare local vs remote versions
|
||||||
|
|
||||||
|
#### Configuration
|
||||||
|
- Centralized `dotfiles.conf` for all settings
|
||||||
|
- Git identity configuration (generated, not hardcoded)
|
||||||
|
- Feature toggles for all optional components
|
||||||
|
- Machine-specific config support via `.zshrc.local`
|
||||||
|
|
||||||
|
#### Installation
|
||||||
|
- `--wizard` flag for interactive TUI installation
|
||||||
|
- `--uninstall` flag to remove symlinks and restore backups
|
||||||
|
- `--purge` flag to completely remove dotfiles
|
||||||
|
- `--skip-deps` flag for faster re-runs
|
||||||
|
- Auto-detection of installed dependencies
|
||||||
|
- Automatic zsh plugin installation
|
||||||
|
|
||||||
|
#### Zsh Theme
|
||||||
|
- Two-line prompt with git integration
|
||||||
|
- Command timer for long-running commands
|
||||||
|
- Root detection (red prompt for root)
|
||||||
|
- Smart path truncation
|
||||||
|
|
||||||
|
#### Espanso
|
||||||
|
- 100+ text expansion snippets
|
||||||
|
- Personal snippet template
|
||||||
|
- Setup script for personalization
|
||||||
|
|
||||||
|
#### Snapper (Arch/CachyOS)
|
||||||
|
- Btrfs snapshot management functions
|
||||||
|
- limine-snapper-sync integration
|
||||||
|
- Boot menu validation
|
||||||
|
|
||||||
|
#### Documentation
|
||||||
|
- Comprehensive README with feature overview
|
||||||
|
- Detailed SETUP_GUIDE with troubleshooting
|
||||||
|
- ESPANSO reference with all snippets
|
||||||
|
- SNAPPER guide for btrfs users
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Optimized `.zshrc` with lazy-loading for NVM and virtualenvwrapper
|
||||||
|
- Streamlined `adlee.zsh-theme` (removed unused functions)
|
||||||
|
- Git config now generated from `dotfiles.conf` instead of hardcoded
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- Hardcoded git credentials from `.gitconfig`
|
||||||
|
- Redundant code in theme file
|
||||||
|
- Duplicate `export ZSH=` statements
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Version History
|
||||||
|
|
||||||
|
### Versioning Scheme
|
||||||
|
|
||||||
|
- **Major** (1.x.x): Breaking changes, major feature additions
|
||||||
|
- **Minor** (x.1.x): New features, non-breaking changes
|
||||||
|
- **Patch** (x.x.1): Bug fixes, documentation updates
|
||||||
|
|
||||||
|
### Checking Your Version
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dotfiles-version.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Updating
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ~/.dotfiles
|
||||||
|
git pull origin main
|
||||||
|
./install.sh --skip-deps
|
||||||
|
```
|
||||||
|
|
||||||
|
Or use:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
update-dotfiles.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Roadmap
|
||||||
|
|
||||||
|
### Planned for 1.1.0
|
||||||
|
- [ ] Multiple theme support with live preview
|
||||||
|
- [ ] Project scaffolding templates
|
||||||
|
- [ ] SSH key generation helper
|
||||||
|
- [ ] Machine profiles (work, personal, server)
|
||||||
|
|
||||||
|
### Planned for 1.2.0
|
||||||
|
- [ ] Dynamic MOTD/welcome screen
|
||||||
|
- [ ] Remote machine bootstrap script
|
||||||
|
- [ ] Neovim configuration support
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
1. Fork the repository
|
||||||
|
2. Create a feature branch
|
||||||
|
3. Make your changes
|
||||||
|
4. Update CHANGELOG.md
|
||||||
|
5. Bump version in `dotfiles.conf`
|
||||||
|
6. Submit a pull request
|
||||||
347
README.md
347
README.md
@@ -6,154 +6,329 @@ Personal configuration files for a fast, consistent dev environment across Linux
|
|||||||
[](https://www.zsh.org/)
|
[](https://www.zsh.org/)
|
||||||
|
|
||||||
```
|
```
|
||||||
┌[alee@catchthesethighs]─[~/.dotfiles ⎇ main]
|
┌[alee@battlestation]─[~/.dotfiles ⎇ main]
|
||||||
└%
|
└%
|
||||||
```
|
```
|
||||||
|
|
||||||
## What's Included
|
## ✨ Features
|
||||||
|
|
||||||
| Component | Description |
|
| Feature | Description |
|
||||||
|-----------|-------------|
|
|---------|-------------|
|
||||||
| **Zsh Theme** | Git status, command timer, smart path truncation |
|
| **Setup Wizard** | Beautiful TUI installer with feature selection |
|
||||||
| **Espanso** | 100+ text snippets (`..date`, `..gst`, `..dps`) |
|
| **Zsh Theme** | Git status, command timer, root detection |
|
||||||
| **CLI Tools** | fzf, bat, eza integrations |
|
| **Command Palette** | Raycast-style fuzzy launcher (Ctrl+Space) |
|
||||||
| **Snapper** | Btrfs snapshot helpers for CachyOS/Arch |
|
| **Smart Suggestions** | Typo correction + alias recommendations |
|
||||||
|
| **Shell Analytics** | Track command usage, get insights |
|
||||||
|
| **Secrets Vault** | Encrypted storage for API keys |
|
||||||
|
| **Dotfiles Sync** | Auto-sync across machines |
|
||||||
|
| **Espanso** | 100+ text expansion snippets |
|
||||||
|
| **Snapper** | Btrfs snapshot helpers (Arch/CachyOS) |
|
||||||
|
|
||||||
## Quick Start
|
## 🚀 Quick Start
|
||||||
|
|
||||||
|
### One-liner Install
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# One-liner
|
|
||||||
curl -fsSL https://raw.githubusercontent.com/adlee-was-taken/dotfiles/main/install.sh | bash
|
curl -fsSL https://raw.githubusercontent.com/adlee-was-taken/dotfiles/main/install.sh | bash
|
||||||
|
|
||||||
# Or clone first
|
|
||||||
git clone https://github.com/adlee-was-taken/dotfiles.git ~/.dotfiles
|
|
||||||
cd ~/.dotfiles && ./install.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The installer backs up existing configs, installs oh-my-zsh + plugins, configures git, and creates symlinks.
|
### Interactive Wizard (Recommended)
|
||||||
|
|
||||||
### Install Options
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./install.sh --skip-deps # Skip dependency check (re-runs)
|
git clone https://github.com/adlee-was-taken/dotfiles.git ~/.dotfiles
|
||||||
./install.sh --uninstall # Remove symlinks
|
cd ~/.dotfiles
|
||||||
./install.sh --uninstall --purge # Remove everything
|
./install.sh --wizard
|
||||||
```
|
```
|
||||||
|
|
||||||
## Repository Layout
|
### Standard Install
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/adlee-was-taken/dotfiles.git ~/.dotfiles
|
||||||
|
cd ~/.dotfiles
|
||||||
|
./install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📁 Repository Layout
|
||||||
|
|
||||||
```
|
```
|
||||||
dotfiles/
|
dotfiles/
|
||||||
├── install.sh # Main installer
|
├── install.sh # Main installer
|
||||||
├── dotfiles.conf # Configuration (fork-friendly)
|
├── dotfiles.conf # Central configuration
|
||||||
├── zsh/
|
├── zsh/
|
||||||
│ ├── .zshrc # Shell config
|
│ ├── .zshrc # Shell config
|
||||||
│ ├── themes/adlee.zsh-theme
|
│ ├── themes/adlee.zsh-theme
|
||||||
│ └── functions/snapper.zsh
|
│ └── functions/
|
||||||
├── espanso/
|
│ ├── snapper.zsh # Btrfs snapshots
|
||||||
│ ├── config/default.yml
|
│ ├── smart-suggest.zsh # Typo correction
|
||||||
|
│ └── command-palette.zsh
|
||||||
|
├── espanso/ # Text expansion
|
||||||
│ └── match/base.yml # 100+ snippets
|
│ └── match/base.yml # 100+ snippets
|
||||||
├── git/.gitconfig.template # Git config template
|
├── bin/ # Utility scripts
|
||||||
|
│ ├── setup-wizard.sh # TUI installer
|
||||||
|
│ ├── dotfiles-doctor.sh # Health checker
|
||||||
|
│ ├── dotfiles-sync.sh # Multi-machine sync
|
||||||
|
│ ├── shell-stats.sh # Analytics
|
||||||
|
│ └── vault.sh # Secrets manager
|
||||||
|
├── git/.gitconfig.template
|
||||||
├── vim/.vimrc
|
├── vim/.vimrc
|
||||||
├── tmux/.tmux.conf
|
├── tmux/.tmux.conf
|
||||||
├── bin/ # Helper scripts
|
└── docs/
|
||||||
│ ├── dotfiles-doctor.sh # Health checker
|
|
||||||
│ ├── dotfiles-version.sh # Version checker
|
|
||||||
│ └── update-dotfiles.sh
|
|
||||||
└── docs/ # Extended docs
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Health Check
|
## 🎮 Command Palette
|
||||||
|
|
||||||
Verify your installation:
|
Press **Ctrl+Space** or **Ctrl+P** to open the fuzzy command launcher:
|
||||||
|
|
||||||
|
```
|
||||||
|
╭──────────────────────────────────────────╮
|
||||||
|
│ ❯ git │
|
||||||
|
├──────────────────────────────────────────┤
|
||||||
|
│ ⎇ git status │
|
||||||
|
│ ⎇ git pull main │
|
||||||
|
│ ⚡ gs (alias → git status) │
|
||||||
|
│ ↺ git commit -m "..." │
|
||||||
|
│ ★ Edit .zshrc │
|
||||||
|
╰──────────────────────────────────────────╯
|
||||||
|
```
|
||||||
|
|
||||||
|
**Searches:** aliases, functions, history, bookmarks, git commands, docker commands, quick actions
|
||||||
|
|
||||||
|
**Keybindings:**
|
||||||
|
- `Enter` - Execute
|
||||||
|
- `Ctrl+E` - Edit before running
|
||||||
|
- `Ctrl+Y` - Copy to clipboard
|
||||||
|
|
||||||
|
### Directory Bookmarks
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bookmark projects ~/projects # Save
|
||||||
|
bookmark list # List all
|
||||||
|
jump projects # Go to bookmark
|
||||||
|
j # Fuzzy select
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🔧 Smart Suggestions
|
||||||
|
|
||||||
|
Automatic typo correction:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ gti status
|
||||||
|
✗ Command not found: gti
|
||||||
|
→ Did you mean: git?
|
||||||
|
|
||||||
|
$ dokcer ps
|
||||||
|
✗ Command not found: dokcer
|
||||||
|
→ Did you mean: docker?
|
||||||
|
```
|
||||||
|
|
||||||
|
Alias recommendations:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
💡 Tip: You've typed 'docker-compose up -d' 15 times
|
||||||
|
Consider adding: alias dcu='docker-compose up -d'
|
||||||
|
```
|
||||||
|
|
||||||
|
Quick fix with `fuck`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ gti status
|
||||||
|
✗ Command not found: gti
|
||||||
|
$ fuck
|
||||||
|
Running: git status
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📊 Shell Analytics
|
||||||
|
|
||||||
|
```bash
|
||||||
|
shell-stats.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
╔═══════════════════════════════════════════════════════════════════╗
|
||||||
|
║ Shell Analytics Dashboard ║
|
||||||
|
╠═══════════════════════════════════════════════════════════════════╣
|
||||||
|
║ Total commands: 4,832 ║
|
||||||
|
║ Unique commands: 847 ║
|
||||||
|
║ ║
|
||||||
|
║ Top Commands ║
|
||||||
|
║ git 847 ████████████████████████░░░░░░ ║
|
||||||
|
║ cd 412 ████████████░░░░░░░░░░░░░░░░░░ ║
|
||||||
|
║ ls 398 ███████████░░░░░░░░░░░░░░░░░░░ ║
|
||||||
|
╚═══════════════════════════════════════════════════════════════════╝
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
shell-stats.sh --suggest # Alias suggestions
|
||||||
|
shell-stats.sh --heatmap # Activity by hour
|
||||||
|
shell-stats.sh --git # Git breakdown
|
||||||
|
shell-stats.sh --dirs # Most visited directories
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🔐 Secrets Vault
|
||||||
|
|
||||||
|
Encrypted storage for API keys and tokens:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
vault set GITHUB_TOKEN ghp_xxxxxxxxxxxx
|
||||||
|
vault set AWS_SECRET_KEY # Prompts (hidden input)
|
||||||
|
vault get GITHUB_TOKEN
|
||||||
|
vault list # Shows keys only
|
||||||
|
vault delete OLD_KEY
|
||||||
|
```
|
||||||
|
|
||||||
|
Export to environment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
eval $(vault shell) # Load all secrets
|
||||||
|
```
|
||||||
|
|
||||||
|
Uses `age` or `gpg` encryption. Secrets auto-load on shell start.
|
||||||
|
|
||||||
|
## 🔄 Dotfiles Sync
|
||||||
|
|
||||||
|
Keep dotfiles synchronized across machines:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dotfiles-sync.sh # Interactive sync
|
||||||
|
dotfiles-sync.sh --status # Show status
|
||||||
|
dotfiles-sync.sh --push # Push changes
|
||||||
|
dotfiles-sync.sh --pull # Pull changes
|
||||||
|
dotfiles-sync.sh --watch 300 # Auto-sync every 5 min
|
||||||
|
```
|
||||||
|
|
||||||
|
On shell start, you'll see:
|
||||||
|
|
||||||
|
```
|
||||||
|
⚠ Dotfiles: 3 update(s) available
|
||||||
|
Run: dotfiles-sync.sh --pull
|
||||||
|
```
|
||||||
|
|
||||||
|
## ⌨️ Espanso Snippets
|
||||||
|
|
||||||
|
All triggers use `..` prefix:
|
||||||
|
|
||||||
|
| Category | Examples |
|
||||||
|
|----------|----------|
|
||||||
|
| **Date/Time** | `..date` → 2025-12-15, `..ts` → ISO timestamp |
|
||||||
|
| **Git** | `..gstat`, `..gcm`, `..branch` (current branch) |
|
||||||
|
| **Docker** | `..dps`, `..dcup`, `..dlog` |
|
||||||
|
| **Symbols** | `..shrug` → ¯\\\_(ツ)\_/¯, `..check` → ✓ |
|
||||||
|
| **Code** | `..bash` → script template, `..python` → main template |
|
||||||
|
|
||||||
|
Full list: [docs/ESPANSO.md](docs/ESPANSO.md)
|
||||||
|
|
||||||
|
## 🎨 Theme Features
|
||||||
|
|
||||||
|
```
|
||||||
|
┌[user@hostname]─[~/projects ⎇ main *]
|
||||||
|
└%
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Git integration** – Branch name with dirty indicator (`*`)
|
||||||
|
- **Command timer** – Shows elapsed time for commands >10s
|
||||||
|
- **Smart paths** – Truncates long directories
|
||||||
|
- **Root detection** – Red prompt for root, blue for users
|
||||||
|
|
||||||
|
## 🩺 Health Check
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dotfiles-doctor.sh # Run diagnostics
|
dotfiles-doctor.sh # Run diagnostics
|
||||||
dotfiles-doctor.sh --fix # Auto-fix issues
|
dotfiles-doctor.sh --fix # Auto-fix issues
|
||||||
dotfiles-version.sh # Check for updates
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Espanso Snippets
|
```
|
||||||
|
━━━ Symlinks ━━━
|
||||||
|
✓ Symlink valid: .zshrc
|
||||||
|
✓ Symlink valid: .gitconfig
|
||||||
|
✓ Symlink valid: adlee.zsh-theme
|
||||||
|
|
||||||
All triggers use `..` prefix to avoid accidents.
|
━━━ Zsh Plugins ━━━
|
||||||
|
✓ Plugin installed: zsh-autosuggestions
|
||||||
|
✓ Plugin installed: zsh-syntax-highlighting
|
||||||
|
|
||||||
| Category | Examples |
|
━━━ Summary ━━━
|
||||||
|----------|----------|
|
Passed: 12
|
||||||
| **Time** | `..date` → 2025-12-14, `..ts` → ISO timestamp, `..epoch` |
|
Warnings: 1
|
||||||
| **Git** | `..gstat`, `..gcm`, `..branch` (current branch) |
|
Failed: 0
|
||||||
| **Docker** | `..dps`, `..dcup`, `..dlog` |
|
```
|
||||||
| **Symbols** | `..shrug` → ¯\\\_(ツ)\_/¯, `..check` → ✓ |
|
|
||||||
|
|
||||||
Full list: [docs/ESPANSO.md](docs/ESPANSO.md)
|
## ⚙️ Configuration
|
||||||
|
|
||||||
## Theme Features
|
All settings in `dotfiles.conf`:
|
||||||
|
|
||||||
- **Git integration** – `⎇ branch` with dirty indicator (`*`)
|
|
||||||
- **Command timer** – shows elapsed time for commands >10s
|
|
||||||
- **Smart paths** – truncates long directories
|
|
||||||
- **User detection** – blue prompt for users, red for root
|
|
||||||
|
|
||||||
## Customization
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Edit theme
|
# Identity
|
||||||
vim ~/.dotfiles/zsh/themes/adlee.zsh-theme
|
USER_FULLNAME="Your Name"
|
||||||
source ~/.zshrc
|
USER_EMAIL="you@example.com"
|
||||||
|
GIT_USER_NAME="" # Falls back to USER_FULLNAME
|
||||||
|
|
||||||
# Add espanso snippets
|
# Features
|
||||||
vim ~/.dotfiles/espanso/match/base.yml
|
INSTALL_ZSH_PLUGINS="true"
|
||||||
espanso restart
|
INSTALL_FZF="ask"
|
||||||
|
INSTALL_ESPANSO="ask"
|
||||||
|
|
||||||
# Add aliases
|
# Advanced
|
||||||
vim ~/.dotfiles/zsh/.zshrc
|
ENABLE_SMART_SUGGESTIONS="true"
|
||||||
|
ENABLE_COMMAND_PALETTE="true"
|
||||||
|
ENABLE_VAULT="true"
|
||||||
|
DOTFILES_AUTO_SYNC_CHECK="true"
|
||||||
```
|
```
|
||||||
|
|
||||||
## System-Wide Theme Deployment
|
## 🔄 Updating
|
||||||
|
|
||||||
Share the theme across all users:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo ./bin/deploy-zshtheme-systemwide.sh --all # All users
|
cd ~/.dotfiles && git pull && ./install.sh
|
||||||
sudo ./bin/deploy-zshtheme-systemwide.sh --status # Check status
|
# or
|
||||||
|
update-dotfiles.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
## Updating
|
Check version:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/.dotfiles
|
dotfiles-version.sh
|
||||||
git pull origin main
|
|
||||||
./install.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Snapper Integration (CachyOS/Arch)
|
## 🗑️ Uninstalling
|
||||||
|
|
||||||
For btrfs systems with limine-snapper-sync:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
snap-create "Before update" # Create + validate limine entry
|
./install.sh --uninstall # Remove symlinks
|
||||||
snap-list # Recent snapshots
|
./install.sh --uninstall --purge # Also delete ~/.dotfiles
|
||||||
snap-check-limine # Verify boot menu sync
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
## 📚 Documentation
|
||||||
|
|
||||||
|
- [Setup Guide](docs/SETUP_GUIDE.md) - Detailed installation instructions
|
||||||
|
- [Espanso Reference](docs/ESPANSO.md) - All text expansion snippets
|
||||||
|
- [Snapper Guide](docs/SNAPPER.md) - Btrfs snapshot management
|
||||||
|
|
||||||
|
## 🛠️ Install Options
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dotfiles-doctor.sh --fix # Auto-diagnose and fix
|
./install.sh # Standard install
|
||||||
|
./install.sh --wizard # Interactive TUI
|
||||||
|
./install.sh --skip-deps # Skip dependency check
|
||||||
|
./install.sh --uninstall # Remove symlinks
|
||||||
|
./install.sh --help # All options
|
||||||
```
|
```
|
||||||
|
|
||||||
| Issue | Fix |
|
## 📋 Requirements
|
||||||
|-------|-----|
|
|
||||||
| Theme not loading | `dotfiles-doctor.sh --fix` |
|
|
||||||
| Zsh plugins missing | `./install.sh` (auto-installs now) |
|
|
||||||
| Espanso not working | `espanso status`, then `espanso restart` |
|
|
||||||
| Broken symlinks | `./install.sh` |
|
|
||||||
| Want to uninstall | `./install.sh --uninstall` |
|
|
||||||
|
|
||||||
## License
|
- **OS:** Linux (Ubuntu, Arch, Fedora) or macOS
|
||||||
|
- **Shell:** Zsh (installed automatically)
|
||||||
|
- **Optional:** fzf (for command palette), age/gpg (for vault)
|
||||||
|
|
||||||
|
## 🤝 Forking
|
||||||
|
|
||||||
|
1. Fork the repo
|
||||||
|
2. Edit `dotfiles.conf` with your settings
|
||||||
|
3. Customize files as needed
|
||||||
|
4. The installer will use your fork's URLs
|
||||||
|
|
||||||
|
## 📄 License
|
||||||
|
|
||||||
MIT – See [LICENSE](LICENSE)
|
MIT – See [LICENSE](LICENSE)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Author**: Aaron D. Lee
|
**Author:** Aaron D. Lee
|
||||||
**Repo**: https://github.com/adlee-was-taken/dotfiles
|
**Repo:** https://github.com/adlee-was-taken/dotfiles
|
||||||
|
|||||||
252
docs/ESPANSO.md
252
docs/ESPANSO.md
@@ -10,26 +10,32 @@ Text expansion with 100+ pre-configured snippets using `..trigger` syntax.
|
|||||||
| Search snippets | `ALT+SPACE` |
|
| Search snippets | `ALT+SPACE` |
|
||||||
| Restart | `espanso restart` |
|
| Restart | `espanso restart` |
|
||||||
| Status | `espanso status` |
|
| Status | `espanso status` |
|
||||||
|
| View logs | `espanso log` |
|
||||||
|
|
||||||
## Snippet Reference
|
---
|
||||||
|
|
||||||
|
## Snippet Categories
|
||||||
|
|
||||||
### Date & Time
|
### Date & Time
|
||||||
|
|
||||||
| Trigger | Output |
|
| Trigger | Output | Example |
|
||||||
|---------|--------|
|
|---------|--------|---------|
|
||||||
| `..date` | 2025-12-14 |
|
| `..date` | Current date | 2025-12-15 |
|
||||||
| `..sds` | 20251214 (filename-safe) |
|
| `..sds` | Filename-safe date | 20251215 |
|
||||||
| `..time` | 14:30:45 |
|
| `..time` | Current time | 14:30:45 |
|
||||||
| `..ts` | 2025-12-14T14:30:45.123Z |
|
| `..ts` | ISO timestamp | 2025-12-15T14:30:45.123Z |
|
||||||
| `..utc` | 2025-12-14 14:30:45.123 UTC |
|
| `..utc` | UTC datetime | 2025-12-15 14:30:45.123 UTC |
|
||||||
| `..dt` | 2025-12-14 14:30:45 EST |
|
| `..dt` | Local datetime | 2025-12-15 14:30:45 EST |
|
||||||
| `..epoch` | 1702573845 |
|
| `..udt` | UTC datetime | 2025-12-15 14:30:45 UTC |
|
||||||
| `..epochms` | 1702573845123 |
|
| `..ztime` | Time with timezone | 14:30:45.123 EST |
|
||||||
| `..month` | December |
|
| `..epoch` | Unix timestamp | 1702573845 |
|
||||||
| `..day` | Saturday |
|
| `..epochms` | Unix ms timestamp | 1702573845123 |
|
||||||
| `..week` | Week 50 |
|
| `..month` | Month name | December |
|
||||||
|
| `..day` | Day name | Saturday |
|
||||||
|
| `..week` | Week number | Week 50 |
|
||||||
|
| `..year` | Year | 2025 |
|
||||||
|
|
||||||
### Git
|
### Git Commands
|
||||||
|
|
||||||
| Trigger | Output |
|
| Trigger | Output |
|
||||||
|---------|--------|
|
|---------|--------|
|
||||||
@@ -39,10 +45,12 @@ Text expansion with 100+ pre-configured snippets using `..trigger` syntax.
|
|||||||
| `..glog` | `git log --oneline --graph --decorate --all` |
|
| `..glog` | `git log --oneline --graph --decorate --all` |
|
||||||
| `..gpush` | `git push origin ` |
|
| `..gpush` | `git push origin ` |
|
||||||
| `..gpull` | `git pull origin ` |
|
| `..gpull` | `git pull origin ` |
|
||||||
|
| `..gbranch` | `git branch -a` |
|
||||||
|
| `..gdiff` | `git diff` |
|
||||||
| `..gadd` | `git add .` |
|
| `..gadd` | `git add .` |
|
||||||
| `..branch` | Current branch name (dynamic) |
|
| `..branch` | Current branch name (dynamic) |
|
||||||
|
|
||||||
### Docker
|
### Docker Commands
|
||||||
|
|
||||||
| Trigger | Output |
|
| Trigger | Output |
|
||||||
|---------|--------|
|
|---------|--------|
|
||||||
@@ -52,6 +60,7 @@ Text expansion with 100+ pre-configured snippets using `..trigger` syntax.
|
|||||||
| `..dcdown` | `docker-compose down` |
|
| `..dcdown` | `docker-compose down` |
|
||||||
| `..dlog` | `docker logs -f ` |
|
| `..dlog` | `docker logs -f ` |
|
||||||
| `..dexec` | `docker exec -it ` |
|
| `..dexec` | `docker exec -it ` |
|
||||||
|
| `..dim` | `docker images` |
|
||||||
| `..dprune` | `docker system prune -af` |
|
| `..dprune` | `docker system prune -af` |
|
||||||
|
|
||||||
### System Info
|
### System Info
|
||||||
@@ -73,11 +82,13 @@ Text expansion with 100+ pre-configured snippets using `..trigger` syntax.
|
|||||||
|
|
||||||
| Trigger | Output |
|
| Trigger | Output |
|
||||||
|---------|--------|
|
|---------|--------|
|
||||||
| `..mdcode` | Code block |
|
| `..mdcode` | Code block (triple backticks) |
|
||||||
| `..mdbash` | Bash code block |
|
| `..mdbash` | Bash code block |
|
||||||
| `..mdpy` | Python code block |
|
| `..mdpy` | Python code block |
|
||||||
|
| `..mdjs` | JavaScript code block |
|
||||||
| `..mdtable` | Table template |
|
| `..mdtable` | Table template |
|
||||||
| `..mdlink` | Link (prompts for text/url) |
|
| `..mdlink` | Link (prompts for text/url) |
|
||||||
|
| `..mdimg` | Image (prompts for alt/url) |
|
||||||
|
|
||||||
### Comments
|
### Comments
|
||||||
|
|
||||||
@@ -87,20 +98,41 @@ Text expansion with 100+ pre-configured snippets using `..trigger` syntax.
|
|||||||
| `..fixme` | `// FIXME: ` |
|
| `..fixme` | `// FIXME: ` |
|
||||||
| `..note` | `// NOTE: ` |
|
| `..note` | `// NOTE: ` |
|
||||||
| `..hack` | `// HACK: ` |
|
| `..hack` | `// HACK: ` |
|
||||||
|
| `..debug` | `// DEBUG: ` |
|
||||||
|
|
||||||
### Quick Commands
|
### Quick Commands
|
||||||
|
|
||||||
| Trigger | Output |
|
| Trigger | Output |
|
||||||
|---------|--------|
|
|---------|--------|
|
||||||
| `..ll` | `ls -lah` |
|
| `..ll` | `ls -lah` |
|
||||||
|
| `..la` | `ls -A` |
|
||||||
| `..grep` | `grep -rni "" .` |
|
| `..grep` | `grep -rni "" .` |
|
||||||
| `..find` | `find . -name ""` |
|
| `..find` | `find . -name ""` |
|
||||||
| `..port` | `lsof -i :` |
|
| `..port` | `lsof -i :` |
|
||||||
|
| `..kill` | `kill -9 ` |
|
||||||
| `..proc` | `ps aux | grep ` |
|
| `..proc` | `ps aux | grep ` |
|
||||||
| `..disk` | `df -h` |
|
| `..disk` | `df -h` |
|
||||||
| `..mem` | `free -h` |
|
| `..mem` | `free -h` |
|
||||||
|
|
||||||
### Emoticons
|
### Navigation
|
||||||
|
|
||||||
|
| Trigger | Output |
|
||||||
|
|---------|--------|
|
||||||
|
| `..~` | `cd ~` |
|
||||||
|
| `..tmp` | `cd /tmp/` |
|
||||||
|
| `..logs` | `cd /var/log/` |
|
||||||
|
|
||||||
|
### URLs
|
||||||
|
|
||||||
|
| Trigger | Output |
|
||||||
|
|---------|--------|
|
||||||
|
| `..gh` | `https://github.com` |
|
||||||
|
| `..gl` | `https://gitlab.com` |
|
||||||
|
| `..gist` | `https://gist.github.com` |
|
||||||
|
| `..so` | `https://stackoverflow.com` |
|
||||||
|
| `..reddit` | `https://reddit.com` |
|
||||||
|
|
||||||
|
### Emoticons & Symbols
|
||||||
|
|
||||||
| Trigger | Output |
|
| Trigger | Output |
|
||||||
|---------|--------|
|
|---------|--------|
|
||||||
@@ -111,19 +143,38 @@ Text expansion with 100+ pre-configured snippets using `..trigger` syntax.
|
|||||||
| `..check` | ✓ |
|
| `..check` | ✓ |
|
||||||
| `..cross` | ✗ |
|
| `..cross` | ✗ |
|
||||||
| `..arrow` | → |
|
| `..arrow` | → |
|
||||||
|
| `..larrow` | ← |
|
||||||
|
|
||||||
### Quick Responses
|
### Quick Responses
|
||||||
|
|
||||||
| Trigger | Output |
|
| Trigger | Output |
|
||||||
|---------|--------|
|
|---------|--------|
|
||||||
| `..brb` | Be right back |
|
| `..brb` | Be right back |
|
||||||
|
| `..omw` | On my way |
|
||||||
|
| `..tyvm` | Thank you very much |
|
||||||
| `..lgtm` | Looks good to me |
|
| `..lgtm` | Looks good to me |
|
||||||
| `..wfm` | Works for me |
|
| `..wfm` | Works for me |
|
||||||
| `..tyvm` | Thank you very much |
|
| `..ack` | Acknowledged |
|
||||||
|
| `..asap` | As soon as possible |
|
||||||
|
|
||||||
### Auto-Corrections
|
### Lorem Ipsum
|
||||||
|
|
||||||
These work without `..` prefix:
|
| Trigger | Output |
|
||||||
|
|---------|--------|
|
||||||
|
| `..lorem` | One paragraph |
|
||||||
|
| `..loremlong` | Four paragraphs |
|
||||||
|
|
||||||
|
### Clipboard
|
||||||
|
|
||||||
|
| Trigger | Output |
|
||||||
|
|---------|--------|
|
||||||
|
| `..qp` | Paste from primary selection (X11/Wayland) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Auto-Corrections
|
||||||
|
|
||||||
|
These work without the `..` prefix:
|
||||||
|
|
||||||
| Typo | Correction |
|
| Typo | Correction |
|
||||||
|------|------------|
|
|------|------------|
|
||||||
@@ -136,17 +187,54 @@ These work without `..` prefix:
|
|||||||
| wierd | weird |
|
| wierd | weird |
|
||||||
| thier | their |
|
| thier | their |
|
||||||
|
|
||||||
## Adding Custom Snippets
|
---
|
||||||
|
|
||||||
Edit `~/.config/espanso/match/base.yml`:
|
## Personal Snippets
|
||||||
|
|
||||||
|
Edit `~/.dotfiles/espanso/match/personal.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
matches:
|
||||||
|
- trigger: "..myemail"
|
||||||
|
replace: "your.email@example.com"
|
||||||
|
|
||||||
|
- trigger: "..myname"
|
||||||
|
replace: "Your Full Name"
|
||||||
|
|
||||||
|
- trigger: "..myphone"
|
||||||
|
replace: "+1 (555) 123-4567"
|
||||||
|
|
||||||
|
- trigger: "..sig"
|
||||||
|
replace: |
|
||||||
|
Best regards,
|
||||||
|
Your Full Name
|
||||||
|
your.email@example.com
|
||||||
|
|
||||||
|
- trigger: "..myaddr"
|
||||||
|
replace: |
|
||||||
|
123 Main Street
|
||||||
|
City, ST 12345
|
||||||
|
```
|
||||||
|
|
||||||
|
Run `setup-espanso.sh` to configure interactively.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Adding Custom Snippets
|
||||||
|
|
||||||
|
Edit `~/.dotfiles/espanso/match/base.yml`:
|
||||||
|
|
||||||
|
### Simple Replacement
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
matches:
|
matches:
|
||||||
# Simple replacement
|
|
||||||
- trigger: "..hw"
|
- trigger: "..hw"
|
||||||
replace: "Hello, World!"
|
replace: "Hello, World!"
|
||||||
|
```
|
||||||
|
|
||||||
# With shell command
|
### With Shell Command
|
||||||
|
|
||||||
|
```yaml
|
||||||
- trigger: "..uptime"
|
- trigger: "..uptime"
|
||||||
replace: "{{output}}"
|
replace: "{{output}}"
|
||||||
vars:
|
vars:
|
||||||
@@ -154,8 +242,11 @@ matches:
|
|||||||
type: shell
|
type: shell
|
||||||
params:
|
params:
|
||||||
cmd: 'uptime -p'
|
cmd: 'uptime -p'
|
||||||
|
```
|
||||||
|
|
||||||
# With date
|
### With Date Formatting
|
||||||
|
|
||||||
|
```yaml
|
||||||
- trigger: "..today"
|
- trigger: "..today"
|
||||||
replace: "Today is {{mydate}}"
|
replace: "Today is {{mydate}}"
|
||||||
vars:
|
vars:
|
||||||
@@ -165,34 +256,129 @@ matches:
|
|||||||
format: "%B %d, %Y"
|
format: "%B %d, %Y"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### With Form Input
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- trigger: "..mailto"
|
||||||
|
replace: "<a href=\"mailto:{{email}}\">{{name}}</a>"
|
||||||
|
vars:
|
||||||
|
- name: email
|
||||||
|
type: form
|
||||||
|
params:
|
||||||
|
layout: "Email: {{email}}"
|
||||||
|
- name: name
|
||||||
|
type: form
|
||||||
|
params:
|
||||||
|
layout: "Display name: {{name}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
### With Clipboard
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- trigger: "..cliplink"
|
||||||
|
replace: "[{{clipboard}}]({{clipboard}})"
|
||||||
|
vars:
|
||||||
|
- name: clipboard
|
||||||
|
type: clipboard
|
||||||
|
```
|
||||||
|
|
||||||
After editing: `espanso restart`
|
After editing: `espanso restart`
|
||||||
|
|
||||||
## Config Locations
|
---
|
||||||
|
|
||||||
|
## Config Files
|
||||||
|
|
||||||
```
|
```
|
||||||
~/.config/espanso/
|
~/.config/espanso/ (symlinked to ~/.dotfiles/espanso/)
|
||||||
├── config/default.yml # Settings
|
├── config/
|
||||||
|
│ └── default.yml # Global settings
|
||||||
└── match/
|
└── match/
|
||||||
├── base.yml # Main snippets
|
├── base.yml # Main snippets (100+)
|
||||||
└── personal.yml # Your info
|
├── personal.yml # Your personal info
|
||||||
|
└── packages/ # Installed packages
|
||||||
```
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
---
|
||||||
|
|
||||||
|
## Useful Commands
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
espanso status # Check if running
|
espanso status # Check if running
|
||||||
|
espanso start # Start service
|
||||||
espanso restart # Restart service
|
espanso restart # Restart service
|
||||||
|
espanso stop # Stop service
|
||||||
espanso log # View logs
|
espanso log # View logs
|
||||||
|
espanso edit # Open config in editor
|
||||||
espanso match list # List all triggers
|
espanso match list # List all triggers
|
||||||
|
espanso path # Show config paths
|
||||||
```
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Installing Packages
|
## Installing Packages
|
||||||
|
|
||||||
|
Browse packages: https://hub.espanso.org/
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
espanso install emoji # :smile: → 😊
|
espanso install emoji # :smile: → 😊
|
||||||
espanso install greek-letters # :alpha: → α
|
espanso install greek-letters # :alpha: → α
|
||||||
espanso install math # :sum: → ∑
|
espanso install math # :sum: → ∑
|
||||||
|
espanso install lorem # More lorem ipsum options
|
||||||
espanso package list # Show installed
|
espanso package list # Show installed
|
||||||
|
espanso package uninstall <n> # Remove package
|
||||||
```
|
```
|
||||||
|
|
||||||
Browse more: https://hub.espanso.org/
|
---
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Espanso Not Starting
|
||||||
|
|
||||||
|
```bash
|
||||||
|
espanso service register # Register as service
|
||||||
|
espanso start
|
||||||
|
```
|
||||||
|
|
||||||
|
### Snippets Not Expanding
|
||||||
|
|
||||||
|
```bash
|
||||||
|
espanso restart
|
||||||
|
espanso log # Check for errors
|
||||||
|
```
|
||||||
|
|
||||||
|
### Wrong Keyboard Layout
|
||||||
|
|
||||||
|
Edit `~/.config/espanso/config/default.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
backend: Clipboard # Try different backend
|
||||||
|
```
|
||||||
|
|
||||||
|
### Check Syntax
|
||||||
|
|
||||||
|
```bash
|
||||||
|
espanso --help # Will error if YAML is invalid
|
||||||
|
espanso match list # Lists triggers if syntax is OK
|
||||||
|
```
|
||||||
|
|
||||||
|
### Wayland Issues
|
||||||
|
|
||||||
|
If using Wayland, you may need the Wayland-specific build:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check your session
|
||||||
|
echo $XDG_SESSION_TYPE
|
||||||
|
|
||||||
|
# Install Wayland version if needed
|
||||||
|
# (varies by distro)
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Tips
|
||||||
|
|
||||||
|
1. **Test snippets** - Type them in any text field
|
||||||
|
2. **Use search** - `ALT+SPACE` to search all triggers
|
||||||
|
3. **Escape triggers** - Type slowly or add a space to prevent expansion
|
||||||
|
4. **Backup config** - It's in your dotfiles, so it syncs automatically
|
||||||
|
5. **Restart after changes** - `espanso restart`
|
||||||
|
|||||||
@@ -1,22 +1,65 @@
|
|||||||
# Setup Guide
|
# Setup Guide
|
||||||
|
|
||||||
Step-by-step instructions for setting up and maintaining your dotfiles.
|
Complete guide for installing, configuring, and maintaining your dotfiles.
|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
|
||||||
|
- [Prerequisites](#prerequisites)
|
||||||
|
- [Installation Methods](#installation-methods)
|
||||||
|
- [Post-Install Setup](#post-install-setup)
|
||||||
|
- [Configuration](#configuration)
|
||||||
|
- [Features Guide](#features-guide)
|
||||||
|
- [Customization](#customization)
|
||||||
|
- [Multi-Machine Setup](#multi-machine-setup)
|
||||||
|
- [Troubleshooting](#troubleshooting)
|
||||||
|
- [Uninstalling](#uninstalling)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
|
**Required:**
|
||||||
- Git
|
- Git
|
||||||
- Curl
|
- Curl
|
||||||
- Zsh (will be installed if missing)
|
- Zsh (installed automatically if missing)
|
||||||
|
|
||||||
## Fresh Install
|
**Optional (for full features):**
|
||||||
|
- `fzf` - For command palette and fuzzy finding
|
||||||
|
- `age` or `gpg` - For secrets vault
|
||||||
|
- `gum` - For beautiful setup wizard
|
||||||
|
|
||||||
### Option 1: One-liner
|
---
|
||||||
|
|
||||||
|
## Installation Methods
|
||||||
|
|
||||||
|
### Method 1: Interactive Wizard (Recommended)
|
||||||
|
|
||||||
|
The wizard provides a beautiful TUI to customize your installation:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/adlee-was-taken/dotfiles.git ~/.dotfiles
|
||||||
|
cd ~/.dotfiles
|
||||||
|
./install.sh --wizard
|
||||||
|
```
|
||||||
|
|
||||||
|
The wizard will guide you through:
|
||||||
|
1. Identity setup (name, email, GitHub)
|
||||||
|
2. Git configuration
|
||||||
|
3. Feature selection
|
||||||
|
4. Theme choice
|
||||||
|
5. Advanced options
|
||||||
|
|
||||||
|
### Method 2: One-liner
|
||||||
|
|
||||||
|
Quick install with defaults:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -fsSL https://raw.githubusercontent.com/adlee-was-taken/dotfiles/main/install.sh | bash
|
curl -fsSL https://raw.githubusercontent.com/adlee-was-taken/dotfiles/main/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
### Option 2: Clone First
|
### Method 3: Standard Install
|
||||||
|
|
||||||
|
Clone and run with prompts:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/adlee-was-taken/dotfiles.git ~/.dotfiles
|
git clone https://github.com/adlee-was-taken/dotfiles.git ~/.dotfiles
|
||||||
@@ -24,119 +67,443 @@ cd ~/.dotfiles
|
|||||||
./install.sh
|
./install.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### What the Installer Does
|
|
||||||
|
|
||||||
1. Detects OS (Ubuntu, Arch, Fedora, macOS)
|
|
||||||
2. Installs dependencies (git, curl, zsh)
|
|
||||||
3. Backs up existing configs to `~/.dotfiles_backup_YYYYMMDD_HHMMSS/`
|
|
||||||
4. Installs oh-my-zsh
|
|
||||||
5. Installs zsh plugins (autosuggestions, syntax-highlighting)
|
|
||||||
6. Configures git (prompts for name/email if not in config)
|
|
||||||
7. Creates symlinks
|
|
||||||
8. Optionally installs espanso, fzf, bat, eza
|
|
||||||
9. Sets zsh as default shell
|
|
||||||
|
|
||||||
### Install Options
|
### Install Options
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./install.sh # Full interactive install
|
./install.sh # Interactive install
|
||||||
./install.sh --skip-deps # Skip dependency check (for re-runs)
|
./install.sh --wizard # TUI wizard
|
||||||
|
./install.sh --skip-deps # Skip dependency installation
|
||||||
./install.sh --deps-only # Only install dependencies
|
./install.sh --deps-only # Only install dependencies
|
||||||
./install.sh --uninstall # Remove symlinks, offer to restore backups
|
./install.sh --uninstall # Remove symlinks
|
||||||
./install.sh --uninstall --purge # Also remove ~/.dotfiles
|
./install.sh --uninstall --purge # Remove everything
|
||||||
./install.sh --help # Show all options
|
./install.sh --help # Show all options
|
||||||
```
|
```
|
||||||
|
|
||||||
## Post-Install
|
---
|
||||||
|
|
||||||
### Verify Installation
|
## Post-Install Setup
|
||||||
|
|
||||||
|
### 1. Verify Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dotfiles-doctor.sh # Check health of installation
|
dotfiles-doctor.sh
|
||||||
dotfiles-doctor.sh --fix # Attempt to fix issues
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Check Version
|
This checks:
|
||||||
|
- All symlinks are valid
|
||||||
|
- Zsh plugins installed
|
||||||
|
- Git configured
|
||||||
|
- Theme loaded
|
||||||
|
- Optional tools present
|
||||||
|
|
||||||
|
Fix issues automatically:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dotfiles-version.sh # Show local vs remote version
|
dotfiles-doctor.sh --fix
|
||||||
dotfiles-version.sh --check # Exit 1 if updates available
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Personalize Espanso
|
### 2. Restart Shell
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./bin/setup-espanso.sh
|
exec zsh
|
||||||
|
# or just close and reopen your terminal
|
||||||
```
|
```
|
||||||
|
|
||||||
Updates `personal.yml` with your name, email, etc.
|
### 3. Personalize Espanso (Optional)
|
||||||
|
|
||||||
### Test It
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
source ~/.zshrc # Reload shell
|
setup-espanso.sh
|
||||||
echo "..date" | espanso # Test espanso (or just type ..date anywhere)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Install Zsh Plugins (if missing)
|
This sets up your personal info for text expansion (email, name, signatures).
|
||||||
|
|
||||||
|
### 4. Set Up Secrets Vault (Optional)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/zsh-users/zsh-autosuggestions \
|
vault init
|
||||||
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
vault set GITHUB_TOKEN "your-token-here"
|
||||||
|
vault list
|
||||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting \
|
|
||||||
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Updating
|
### 5. Configure Directory Bookmarks (Optional)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/.dotfiles
|
bookmark projects ~/projects
|
||||||
git pull origin main
|
bookmark work ~/work
|
||||||
./install.sh
|
bookmark list
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### Main Configuration File
|
||||||
|
|
||||||
|
All settings are in `~/.dotfiles/dotfiles.conf`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# ============================================================================
|
||||||
|
# Identity
|
||||||
|
# ============================================================================
|
||||||
|
USER_FULLNAME="Your Name"
|
||||||
|
USER_EMAIL="you@example.com"
|
||||||
|
USER_GITHUB="yourusername"
|
||||||
|
|
||||||
|
# ============================================================================
|
||||||
|
# Git Configuration
|
||||||
|
# ============================================================================
|
||||||
|
GIT_USER_NAME="" # Falls back to USER_FULLNAME
|
||||||
|
GIT_USER_EMAIL="" # Falls back to USER_EMAIL
|
||||||
|
GIT_DEFAULT_BRANCH="main"
|
||||||
|
GIT_CREDENTIAL_HELPER="store"
|
||||||
|
|
||||||
|
# ============================================================================
|
||||||
|
# Feature Toggles
|
||||||
|
# ============================================================================
|
||||||
|
# Values: "true", "false", or "ask"
|
||||||
|
|
||||||
|
INSTALL_DEPS="auto" # Auto-skip if already installed
|
||||||
|
INSTALL_ZSH_PLUGINS="true" # zsh-autosuggestions, syntax-highlighting
|
||||||
|
INSTALL_FZF="ask"
|
||||||
|
INSTALL_BAT="ask"
|
||||||
|
INSTALL_EZA="ask"
|
||||||
|
INSTALL_ESPANSO="ask"
|
||||||
|
SET_ZSH_DEFAULT="ask"
|
||||||
|
|
||||||
|
# ============================================================================
|
||||||
|
# Advanced Features
|
||||||
|
# ============================================================================
|
||||||
|
ENABLE_SMART_SUGGESTIONS="true" # Typo correction
|
||||||
|
ENABLE_COMMAND_PALETTE="true" # Ctrl+Space launcher
|
||||||
|
ENABLE_SHELL_ANALYTICS="false" # Command stats
|
||||||
|
ENABLE_VAULT="true" # Encrypted secrets
|
||||||
|
DOTFILES_AUTO_SYNC_CHECK="true" # Check for updates on shell start
|
||||||
|
```
|
||||||
|
|
||||||
|
### Applying Configuration Changes
|
||||||
|
|
||||||
|
After editing `dotfiles.conf`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./install.sh --skip-deps
|
||||||
|
# or just
|
||||||
source ~/.zshrc
|
source ~/.zshrc
|
||||||
```
|
```
|
||||||
|
|
||||||
Or use the helper:
|
---
|
||||||
|
|
||||||
|
## Features Guide
|
||||||
|
|
||||||
|
### Command Palette
|
||||||
|
|
||||||
|
**Trigger:** `Ctrl+Space` or `Ctrl+P`
|
||||||
|
|
||||||
|
The command palette searches:
|
||||||
|
- ⚡ Aliases
|
||||||
|
- λ Functions
|
||||||
|
- ↺ Recent commands
|
||||||
|
- 📁 Bookmarked directories
|
||||||
|
- ⚙ Dotfiles scripts
|
||||||
|
- ★ Quick actions
|
||||||
|
- ⎇ Git commands (context-aware)
|
||||||
|
- ◉ Docker commands
|
||||||
|
|
||||||
|
**Keybindings in palette:**
|
||||||
|
| Key | Action |
|
||||||
|
|-----|--------|
|
||||||
|
| `Enter` | Execute command |
|
||||||
|
| `Ctrl+E` | Edit command first |
|
||||||
|
| `Ctrl+Y` | Copy to clipboard |
|
||||||
|
| `Ctrl+R` | Refresh entries |
|
||||||
|
| `Esc` | Cancel |
|
||||||
|
|
||||||
|
**Bookmarks:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
update-dotfiles.sh
|
bookmark <name> [path] # Save bookmark (default: current dir)
|
||||||
|
bookmark list # List all bookmarks
|
||||||
|
bookmark delete <name> # Remove bookmark
|
||||||
|
jump <name> # Go to bookmark
|
||||||
|
j # Fuzzy select bookmark
|
||||||
```
|
```
|
||||||
|
|
||||||
## Pushing Changes
|
### Smart Suggestions
|
||||||
|
|
||||||
|
Automatically corrects 100+ common typos:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gti → git
|
||||||
|
dokcer → docker
|
||||||
|
sl → ls
|
||||||
|
pytohn → python
|
||||||
|
```
|
||||||
|
|
||||||
|
Suggests aliases for frequently typed commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
💡 You've typed 'git status' 50 times
|
||||||
|
You already have an alias: gs
|
||||||
|
```
|
||||||
|
|
||||||
|
**Commands:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
fuck # Re-run last command with typo fixed
|
||||||
|
```
|
||||||
|
|
||||||
|
### Shell Analytics
|
||||||
|
|
||||||
|
```bash
|
||||||
|
shell-stats.sh # Full dashboard
|
||||||
|
shell-stats.sh --top 20 # Top 20 commands
|
||||||
|
shell-stats.sh --suggest # Alias recommendations
|
||||||
|
shell-stats.sh --heatmap # Activity by hour
|
||||||
|
shell-stats.sh --dirs # Most visited directories
|
||||||
|
shell-stats.sh --git # Git command breakdown
|
||||||
|
shell-stats.sh --docker # Docker command breakdown
|
||||||
|
shell-stats.sh --export # Export as JSON
|
||||||
|
```
|
||||||
|
|
||||||
|
### Secrets Vault
|
||||||
|
|
||||||
|
Encrypted storage using `age` or `gpg`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
vault set KEY "value" # Store (or prompt for value)
|
||||||
|
vault get KEY # Retrieve
|
||||||
|
vault list # Show all keys
|
||||||
|
vault delete KEY # Remove
|
||||||
|
vault shell # Print as export statements
|
||||||
|
vault export backup.enc # Backup encrypted vault
|
||||||
|
vault import backup.enc # Restore vault
|
||||||
|
vault status # Show vault info
|
||||||
|
```
|
||||||
|
|
||||||
|
**Auto-loading:** Secrets are automatically loaded into your environment on shell start.
|
||||||
|
|
||||||
|
### Dotfiles Sync
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dotfiles-sync.sh # Interactive sync
|
||||||
|
dotfiles-sync.sh --status # Show sync status
|
||||||
|
dotfiles-sync.sh --push # Push local changes
|
||||||
|
dotfiles-sync.sh --pull # Pull remote changes
|
||||||
|
dotfiles-sync.sh --diff # Show local changes
|
||||||
|
dotfiles-sync.sh --watch 300 # Auto-sync every 5 minutes
|
||||||
|
dotfiles-sync.sh --log # Show sync history
|
||||||
|
```
|
||||||
|
|
||||||
|
**Auto-check:** On shell start, you'll be notified of available updates.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Customization
|
||||||
|
|
||||||
|
### Adding Aliases
|
||||||
|
|
||||||
|
Edit `~/.dotfiles/zsh/.zshrc`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Custom aliases
|
||||||
|
alias projects='cd ~/projects'
|
||||||
|
alias k='kubectl'
|
||||||
|
alias tf='terraform'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Machine-Specific Config
|
||||||
|
|
||||||
|
Create `~/.zshrc.local` (not tracked by git):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Work machine
|
||||||
|
export CORP_PROXY="http://proxy:8080"
|
||||||
|
export WORK_EMAIL="me@company.com"
|
||||||
|
|
||||||
|
# Local paths
|
||||||
|
export PATH="$HOME/work-tools/bin:$PATH"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Custom Espanso Snippets
|
||||||
|
|
||||||
|
Edit `~/.dotfiles/espanso/match/personal.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
matches:
|
||||||
|
- trigger: "..myemail"
|
||||||
|
replace: "your.email@example.com"
|
||||||
|
|
||||||
|
- trigger: "..sig"
|
||||||
|
replace: |
|
||||||
|
Best regards,
|
||||||
|
Your Name
|
||||||
|
```
|
||||||
|
|
||||||
|
### Theme Customization
|
||||||
|
|
||||||
|
Edit `~/.dotfiles/zsh/themes/adlee.zsh-theme`:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
# Change colors
|
||||||
|
typeset -g COLOR_GREEN='%{$FG[118]%}'
|
||||||
|
typeset -g COLOR_BLUE='%{$FG[069]%}'
|
||||||
|
|
||||||
|
# Change timer threshold (seconds)
|
||||||
|
typeset -g TIMER_THRESHOLD=10
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Multi-Machine Setup
|
||||||
|
|
||||||
|
### Initial Setup on New Machine
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Clone your dotfiles
|
||||||
|
git clone https://github.com/YOUR_USER/dotfiles.git ~/.dotfiles
|
||||||
|
cd ~/.dotfiles
|
||||||
|
./install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Syncing Changes
|
||||||
|
|
||||||
|
**On Machine A (make changes):**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/.dotfiles
|
cd ~/.dotfiles
|
||||||
git add .
|
# Edit files...
|
||||||
git commit -m "Update aliases"
|
dotfiles-sync.sh --push "Added new aliases"
|
||||||
git push origin main
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Multi-Machine Sync
|
**On Machine B (get changes):**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Machine A: push changes
|
dotfiles-sync.sh --pull
|
||||||
cd ~/.dotfiles && git add . && git commit -m "Update" && git push
|
source ~/.zshrc
|
||||||
|
|
||||||
# Machine B: pull changes
|
|
||||||
cd ~/.dotfiles && git pull && source ~/.zshrc
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## File Structure
|
### Automatic Sync
|
||||||
|
|
||||||
| Path | Purpose |
|
Enable watch mode (runs in background):
|
||||||
|------|---------|
|
|
||||||
| `zsh/.zshrc` | Main shell config |
|
|
||||||
| `zsh/themes/adlee.zsh-theme` | Prompt theme |
|
|
||||||
| `zsh/functions/snapper.zsh` | Btrfs snapshot helpers |
|
|
||||||
| `espanso/match/base.yml` | Text snippets |
|
|
||||||
| `espanso/match/personal.yml` | Your personal info |
|
|
||||||
| `git/.gitconfig` | Git settings |
|
|
||||||
| `vim/.vimrc` | Vim config |
|
|
||||||
| `tmux/.tmux.conf` | Tmux config |
|
|
||||||
| `bin/` | Utility scripts |
|
|
||||||
|
|
||||||
## Symlinks Created
|
```bash
|
||||||
|
dotfiles-sync.sh --watch 300 # Check every 5 minutes
|
||||||
|
```
|
||||||
|
|
||||||
|
Or add to crontab:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
*/30 * * * * ~/.dotfiles/bin/dotfiles-sync.sh --auto
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Run the Doctor First
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dotfiles-doctor.sh --fix
|
||||||
|
```
|
||||||
|
|
||||||
|
### Common Issues
|
||||||
|
|
||||||
|
| Issue | Solution |
|
||||||
|
|-------|----------|
|
||||||
|
| Theme not loading | Check `ZSH_THEME="adlee"` in .zshrc, run `source ~/.zshrc` |
|
||||||
|
| Zsh plugins missing | Run `./install.sh` (auto-installs plugins now) |
|
||||||
|
| Command palette not working | Install fzf: `./install.sh` will prompt |
|
||||||
|
| Vault errors | Install age: `brew install age` or `pacman -S age` |
|
||||||
|
| Espanso not expanding | Run `espanso status`, then `espanso restart` |
|
||||||
|
| Sync conflicts | Run `dotfiles-sync.sh --conflicts` to see conflicts |
|
||||||
|
| Symlinks broken | Run `./install.sh --skip-deps` to recreate |
|
||||||
|
|
||||||
|
### Manual Fixes
|
||||||
|
|
||||||
|
**Reinstall zsh plugins:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rm -rf ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
|
||||||
|
rm -rf ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
|
||||||
|
./install.sh --skip-deps
|
||||||
|
```
|
||||||
|
|
||||||
|
**Reset git config:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rm ~/.gitconfig
|
||||||
|
./install.sh --skip-deps
|
||||||
|
```
|
||||||
|
|
||||||
|
**Fix permissions:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chmod +x ~/.dotfiles/install.sh
|
||||||
|
chmod +x ~/.dotfiles/bin/*
|
||||||
|
```
|
||||||
|
|
||||||
|
### Getting Help
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Any script
|
||||||
|
<script> --help
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
./install.sh --help
|
||||||
|
vault --help
|
||||||
|
dotfiles-sync.sh --help
|
||||||
|
shell-stats.sh --help
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Uninstalling
|
||||||
|
|
||||||
|
### Quick Uninstall
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./install.sh --uninstall
|
||||||
|
```
|
||||||
|
|
||||||
|
This will:
|
||||||
|
1. Remove all symlinks
|
||||||
|
2. Find and offer to restore backups
|
||||||
|
3. Keep ~/.dotfiles directory
|
||||||
|
|
||||||
|
### Complete Removal
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./install.sh --uninstall --purge
|
||||||
|
```
|
||||||
|
|
||||||
|
This also removes the `~/.dotfiles` directory.
|
||||||
|
|
||||||
|
### Manual Uninstall
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Remove symlinks
|
||||||
|
rm ~/.zshrc ~/.gitconfig ~/.vimrc ~/.tmux.conf
|
||||||
|
rm ~/.oh-my-zsh/themes/adlee.zsh-theme
|
||||||
|
rm -rf ~/.config/espanso
|
||||||
|
rm ~/.local/bin/dotfiles-*.sh ~/.local/bin/vault.sh ~/.local/bin/shell-stats.sh
|
||||||
|
|
||||||
|
# Restore backups (if any)
|
||||||
|
ls ~/.dotfiles_backup_*
|
||||||
|
|
||||||
|
# Remove dotfiles
|
||||||
|
rm -rf ~/.dotfiles
|
||||||
|
|
||||||
|
# Optional: Remove oh-my-zsh
|
||||||
|
rm -rf ~/.oh-my-zsh
|
||||||
|
|
||||||
|
# Change shell back to bash
|
||||||
|
chsh -s /bin/bash
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## File Reference
|
||||||
|
|
||||||
|
### Symlinks Created
|
||||||
|
|
||||||
| Source | Target |
|
| Source | Target |
|
||||||
|--------|--------|
|
|--------|--------|
|
||||||
@@ -146,156 +513,27 @@ cd ~/.dotfiles && git pull && source ~/.zshrc
|
|||||||
| `~/.dotfiles/vim/.vimrc` | `~/.vimrc` |
|
| `~/.dotfiles/vim/.vimrc` | `~/.vimrc` |
|
||||||
| `~/.dotfiles/tmux/.tmux.conf` | `~/.tmux.conf` |
|
| `~/.dotfiles/tmux/.tmux.conf` | `~/.tmux.conf` |
|
||||||
| `~/.dotfiles/espanso/` | `~/.config/espanso` |
|
| `~/.dotfiles/espanso/` | `~/.config/espanso` |
|
||||||
|
| `~/.dotfiles/bin/*` | `~/.local/bin/*` |
|
||||||
|
|
||||||
## System-Wide Theme
|
### Key Files
|
||||||
|
|
||||||
Deploy to all users on a system:
|
| File | Purpose |
|
||||||
|
|------|---------|
|
||||||
|
| `dotfiles.conf` | Central configuration |
|
||||||
|
| `zsh/.zshrc` | Main shell config |
|
||||||
|
| `zsh/themes/adlee.zsh-theme` | Prompt theme |
|
||||||
|
| `zsh/functions/smart-suggest.zsh` | Typo correction |
|
||||||
|
| `zsh/functions/command-palette.zsh` | Fuzzy launcher |
|
||||||
|
| `espanso/match/base.yml` | Text expansion snippets |
|
||||||
|
| `espanso/match/personal.yml` | Personal snippets |
|
||||||
|
| `vault/` | Encrypted secrets (gitignored) |
|
||||||
|
|
||||||
```bash
|
---
|
||||||
# Interactive
|
|
||||||
sudo ./bin/deploy-zshtheme-systemwide.sh
|
|
||||||
|
|
||||||
# All users with oh-my-zsh
|
## Security Notes
|
||||||
sudo ./bin/deploy-zshtheme-systemwide.sh --all
|
|
||||||
|
|
||||||
# Current user + root only
|
- `.gitignore` excludes sensitive files (`.env`, `secrets/`, `*.local`, `vault/`)
|
||||||
sudo ./bin/deploy-zshtheme-systemwide.sh --current
|
- Vault uses strong encryption (age/gpg)
|
||||||
|
- Never commit API keys or tokens
|
||||||
# Check status
|
- Review `git/.gitconfig` before pushing (contains email)
|
||||||
sudo ./bin/deploy-zshtheme-systemwide.sh --status
|
- Personal espanso snippets may contain sensitive info
|
||||||
```
|
|
||||||
|
|
||||||
Creates symlinks from each user's oh-my-zsh themes folder to `/usr/local/share/zsh/themes/adlee.zsh-theme`.
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
### dotfiles.conf
|
|
||||||
|
|
||||||
The main configuration file. Edit to customize your installation:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# --- Version ---
|
|
||||||
DOTFILES_VERSION="1.0.0"
|
|
||||||
|
|
||||||
# --- User Identity ---
|
|
||||||
USER_FULLNAME="Your Name"
|
|
||||||
USER_EMAIL="you@example.com"
|
|
||||||
USER_GITHUB="yourusername"
|
|
||||||
|
|
||||||
# --- Git Configuration ---
|
|
||||||
GIT_USER_NAME="" # Falls back to USER_FULLNAME
|
|
||||||
GIT_USER_EMAIL="" # Falls back to USER_EMAIL
|
|
||||||
GIT_DEFAULT_BRANCH="main"
|
|
||||||
GIT_CREDENTIAL_HELPER="store"
|
|
||||||
|
|
||||||
# --- Feature Toggles ---
|
|
||||||
INSTALL_DEPS="auto" # "auto", "true", "false", or "ask"
|
|
||||||
INSTALL_ZSH_PLUGINS="true" # Auto-install zsh plugins
|
|
||||||
INSTALL_ESPANSO="ask"
|
|
||||||
INSTALL_FZF="ask"
|
|
||||||
INSTALL_BAT="ask"
|
|
||||||
INSTALL_EZA="ask"
|
|
||||||
SET_ZSH_DEFAULT="ask"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Git Identity
|
|
||||||
|
|
||||||
The installer configures git automatically:
|
|
||||||
|
|
||||||
1. Uses `GIT_USER_NAME` / `GIT_USER_EMAIL` from config
|
|
||||||
2. Falls back to `USER_FULLNAME` / `USER_EMAIL`
|
|
||||||
3. Prompts if both are empty
|
|
||||||
|
|
||||||
To reconfigure git later:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git config --global user.name "New Name"
|
|
||||||
git config --global user.email "new@email.com"
|
|
||||||
```
|
|
||||||
|
|
||||||
Or edit `dotfiles.conf` and re-run `./install.sh`.
|
|
||||||
|
|
||||||
## Customization Tips
|
|
||||||
|
|
||||||
### Add Aliases
|
|
||||||
|
|
||||||
Edit `~/.dotfiles/zsh/.zshrc`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
alias projects='cd ~/projects'
|
|
||||||
alias k='kubectl'
|
|
||||||
```
|
|
||||||
|
|
||||||
### Machine-Specific Config
|
|
||||||
|
|
||||||
Create `~/.zshrc.local` (not tracked by git):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Work machine specific
|
|
||||||
export WORK_API_KEY="xxx"
|
|
||||||
alias vpn='sudo openconnect ...'
|
|
||||||
```
|
|
||||||
|
|
||||||
### Theme Colors
|
|
||||||
|
|
||||||
Edit `~/.dotfiles/zsh/themes/adlee.zsh-theme` and look for:
|
|
||||||
|
|
||||||
```zsh
|
|
||||||
typeset -g COLOR_GREEN='%{$FG[118]%}'
|
|
||||||
typeset -g COLOR_BLUE='%{$FG[069]%}'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
### Run the Doctor
|
|
||||||
|
|
||||||
```bash
|
|
||||||
dotfiles-doctor.sh # Diagnose issues
|
|
||||||
dotfiles-doctor.sh --fix # Auto-fix what's possible
|
|
||||||
```
|
|
||||||
|
|
||||||
### Common Issues
|
|
||||||
|
|
||||||
| Issue | Fix |
|
|
||||||
|-------|-----|
|
|
||||||
| Theme not loading | `dotfiles-doctor.sh --fix` |
|
|
||||||
| Zsh plugins missing | `./install.sh` (auto-installs) |
|
|
||||||
| Espanso not expanding | `espanso restart` |
|
|
||||||
| Git identity not set | Re-run `./install.sh` |
|
|
||||||
| Broken symlinks | `./install.sh` |
|
|
||||||
|
|
||||||
### Manual Fixes
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Reinstall zsh plugins
|
|
||||||
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
|
||||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
|
||||||
|
|
||||||
# Fix permissions
|
|
||||||
chmod +x ~/.dotfiles/install.sh
|
|
||||||
chmod +x ~/.dotfiles/bin/*
|
|
||||||
```
|
|
||||||
|
|
||||||
## Uninstalling
|
|
||||||
|
|
||||||
### Quick Uninstall
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./install.sh --uninstall # Remove symlinks, offer backup restore
|
|
||||||
./install.sh --uninstall --purge # Also delete ~/.dotfiles
|
|
||||||
```
|
|
||||||
|
|
||||||
### Manual Uninstall
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Remove symlinks
|
|
||||||
rm ~/.zshrc ~/.gitconfig ~/.vimrc ~/.tmux.conf
|
|
||||||
rm ~/.oh-my-zsh/themes/adlee.zsh-theme
|
|
||||||
rm -rf ~/.config/espanso
|
|
||||||
|
|
||||||
# Restore backups
|
|
||||||
cp ~/.dotfiles_backup_*/.zshrc ~/
|
|
||||||
|
|
||||||
# Remove dotfiles
|
|
||||||
rm -rf ~/.dotfiles
|
|
||||||
```
|
|
||||||
|
|||||||
236
docs/SNAPPER.md
236
docs/SNAPPER.md
@@ -7,31 +7,24 @@ Zsh functions for managing btrfs snapshots with limine-snapper-sync integration
|
|||||||
- Btrfs filesystem with snapper configured
|
- Btrfs filesystem with snapper configured
|
||||||
- `limine-snapper-sync` package (AUR)
|
- `limine-snapper-sync` package (AUR)
|
||||||
- Snapper config named "root"
|
- Snapper config named "root"
|
||||||
|
- Limine bootloader
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Quick Reference
|
## Quick Reference
|
||||||
|
|
||||||
| Command | Description |
|
| Command | Alias | Description |
|
||||||
|---------|-------------|
|
|---------|-------|-------------|
|
||||||
| `snap-create "desc"` | Create snapshot + validate limine entry |
|
| `snap-create "desc"` | `snap` | Create snapshot + validate limine entry |
|
||||||
| `snap-list [n]` | Show last n snapshots (default: 10) |
|
| `snap-list [n]` | `snapls` | Show last n snapshots (default: 10) |
|
||||||
| `snap-show <num>` | Details for specific snapshot |
|
| `snap-show <num>` | `snapshow` | Details for specific snapshot |
|
||||||
| `snap-delete <num>` | Delete snapshot + update limine |
|
| `snap-delete <num>` | `snaprm` | Delete snapshot + update limine |
|
||||||
| `snap-check-limine` | Verify boot menu sync status |
|
| `snap-check-limine` | `snapcheck` | Verify boot menu sync status |
|
||||||
| `snap-sync` | Manually trigger limine sync |
|
| `snap-sync` | `snapsync` | Manually trigger limine sync |
|
||||||
| `snap-info` | Detailed breakdown by type |
|
| `snap-info` | `snapinfo` | Detailed breakdown by type |
|
||||||
| `snap-validate-service` | Check service health |
|
| `snap-validate-service` | - | Check service health |
|
||||||
|
|
||||||
### Aliases
|
---
|
||||||
|
|
||||||
```bash
|
|
||||||
snap → snap-create
|
|
||||||
snapls → snap-list
|
|
||||||
snaprm → snap-delete
|
|
||||||
snapshow → snap-show
|
|
||||||
snapcheck → snap-check-limine
|
|
||||||
snapsync → snap-sync
|
|
||||||
snapinfo → snap-info
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage Examples
|
## Usage Examples
|
||||||
|
|
||||||
@@ -39,46 +32,100 @@ snapinfo → snap-info
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
snap-create "Before system update"
|
snap-create "Before system update"
|
||||||
# or just:
|
# or using alias:
|
||||||
snap "Before system update"
|
snap "Before system update"
|
||||||
```
|
```
|
||||||
|
|
||||||
Output shows:
|
Output:
|
||||||
- Snapshot number created
|
|
||||||
- Limine sync trigger
|
```
|
||||||
- Validation that entry was added to boot menu
|
╔════════════════════════════════════════════════════════════╗
|
||||||
|
║ Snapper Snapshot Creation & Validation ║
|
||||||
|
╚════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
==> Checking limine.conf state before snapshot
|
||||||
|
✓ Before: 5 snapshot entries
|
||||||
|
✓ Before checksum: a1b2c3d4...
|
||||||
|
|
||||||
|
==> Creating snapshot: "Before system update"
|
||||||
|
✓ Snapshot created: #42
|
||||||
|
|
||||||
|
==> Triggering limine-snapper-sync service...
|
||||||
|
✓ Service triggered successfully
|
||||||
|
|
||||||
|
==> Validating limine.conf update
|
||||||
|
✓ limine.conf was updated
|
||||||
|
✓ Added 1 new snapshot entry
|
||||||
|
✓ Found snapshot #42 in limine.conf
|
||||||
|
|
||||||
|
╔════════════════════════════════════════════════════════════╗
|
||||||
|
║ Summary ║
|
||||||
|
╚════════════════════════════════════════════════════════════╝
|
||||||
|
Snapshot Number: #42
|
||||||
|
Description: "Before system update"
|
||||||
|
Status: ✓ VALIDATED
|
||||||
|
```
|
||||||
|
|
||||||
### Check Boot Menu Sync
|
### Check Boot Menu Sync
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
snap-check-limine
|
snap-check-limine
|
||||||
|
# or:
|
||||||
|
snapcheck
|
||||||
```
|
```
|
||||||
|
|
||||||
Shows:
|
Shows:
|
||||||
- All snapshots in limine.conf
|
- All snapshots in limine.conf
|
||||||
- Comparison with snapper list
|
- Comparison with snapper list
|
||||||
- Missing entries (if any)
|
- Missing entries (if any)
|
||||||
|
- Sync status
|
||||||
|
|
||||||
### Pre/Post System Changes
|
### List Recent Snapshots
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Before risky change
|
snap-list # Last 10
|
||||||
snap "Before kernel update"
|
snap-list 20 # Last 20
|
||||||
|
# or:
|
||||||
# Make changes...
|
snapls 20
|
||||||
sudo pacman -Syu
|
|
||||||
|
|
||||||
# If something breaks, boot into the snapshot from limine menu
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### View Snapshot Details
|
||||||
|
|
||||||
|
```bash
|
||||||
|
snap-show 42
|
||||||
|
# or:
|
||||||
|
snapshow 42
|
||||||
|
```
|
||||||
|
|
||||||
|
Shows:
|
||||||
|
- Snapshot info from snapper
|
||||||
|
- Corresponding entry in limine.conf
|
||||||
|
|
||||||
|
### Delete Snapshot
|
||||||
|
|
||||||
|
```bash
|
||||||
|
snap-delete 42
|
||||||
|
# or:
|
||||||
|
snaprm 42
|
||||||
|
```
|
||||||
|
|
||||||
|
Automatically:
|
||||||
|
- Deletes snapshot from snapper
|
||||||
|
- Triggers limine-snapper-sync
|
||||||
|
- Verifies removal from boot menu
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
1. **snap-create** calls `snapper -c root create`
|
1. **`snap-create`** calls `snapper -c root create`
|
||||||
2. Triggers `limine-snapper-sync.service`
|
2. Triggers `limine-snapper-sync.service`
|
||||||
3. Validates that `/boot/limine.conf` was updated
|
3. Validates that `/boot/limine.conf` was updated
|
||||||
4. Shows the new boot entry
|
4. Shows the new boot entry
|
||||||
|
|
||||||
The limine bootloader can then boot any snapshot directly.
|
The limine bootloader can then boot any snapshot directly from the boot menu.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Snapshot Types
|
## Snapshot Types
|
||||||
|
|
||||||
@@ -88,7 +135,26 @@ The limine bootloader can then boot any snapshot directly.
|
|||||||
| `pre` | Auto before package operations |
|
| `pre` | Auto before package operations |
|
||||||
| `post` | Auto after package operations |
|
| `post` | Auto after package operations |
|
||||||
|
|
||||||
View with `snap-info`.
|
View breakdown with `snap-info` or `snapinfo`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Pre/Post System Changes Workflow
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Before risky change
|
||||||
|
snap "Before kernel update"
|
||||||
|
|
||||||
|
# Make changes
|
||||||
|
sudo pacman -Syu
|
||||||
|
|
||||||
|
# If something breaks:
|
||||||
|
# 1. Reboot
|
||||||
|
# 2. Select snapshot from limine boot menu
|
||||||
|
# 3. System restored to pre-update state
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
@@ -100,6 +166,8 @@ snap-validate-service
|
|||||||
|
|
||||||
# Manual sync
|
# Manual sync
|
||||||
snap-sync
|
snap-sync
|
||||||
|
# or:
|
||||||
|
snapsync
|
||||||
|
|
||||||
# Verify
|
# Verify
|
||||||
snap-check-limine
|
snap-check-limine
|
||||||
@@ -121,17 +189,95 @@ snap-delete 42
|
|||||||
# This auto-triggers sync to remove from limine.conf
|
# This auto-triggers sync to remove from limine.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Check Service Logs
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo journalctl -u limine-snapper-sync.service -n 50
|
||||||
|
```
|
||||||
|
|
||||||
|
### Validate Everything
|
||||||
|
|
||||||
|
```bash
|
||||||
|
snap-validate-service
|
||||||
|
```
|
||||||
|
|
||||||
|
This checks:
|
||||||
|
- Service unit exists
|
||||||
|
- Service is enabled
|
||||||
|
- Snapper config exists
|
||||||
|
- limine.conf exists
|
||||||
|
- Current sync status
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Functions are in `~/.dotfiles/zsh/functions/snapper.zsh` and sourced by `.zshrc`.
|
Functions are sourced from `~/.dotfiles/zsh/functions/snapper.zsh`.
|
||||||
|
|
||||||
Key settings:
|
Settings in `~/.dotfiles/dotfiles.conf`:
|
||||||
- Snapper config: `root`
|
|
||||||
- Limine config: `/boot/limine.conf`
|
```bash
|
||||||
- Sync service: `limine-snapper-sync.service`
|
SNAPPER_CONFIG="root"
|
||||||
|
LIMINE_CONF="/boot/limine.conf"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
|
|
||||||
- Only works with limine bootloader
|
- Only works with **limine bootloader**
|
||||||
- Requires snapper config named "root"
|
- Requires snapper config named **"root"**
|
||||||
- limine-snapper-sync typically limits boot entries to recent snapshots (this is intentional to prevent menu clutter)
|
- `limine-snapper-sync` typically limits boot entries to recent snapshots (intentional to prevent menu clutter)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Installing limine-snapper-sync
|
||||||
|
|
||||||
|
On Arch/CachyOS:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# If using paru
|
||||||
|
paru -S limine-snapper-sync
|
||||||
|
|
||||||
|
# If using yay
|
||||||
|
yay -S limine-snapper-sync
|
||||||
|
|
||||||
|
# Enable service
|
||||||
|
sudo systemctl enable limine-snapper-sync.service
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Manual Snapper Commands
|
||||||
|
|
||||||
|
If you need to use snapper directly:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# List all snapshots
|
||||||
|
sudo snapper -c root list
|
||||||
|
|
||||||
|
# Create snapshot
|
||||||
|
sudo snapper -c root create --description "My snapshot"
|
||||||
|
|
||||||
|
# Delete snapshot
|
||||||
|
sudo snapper -c root delete 42
|
||||||
|
|
||||||
|
# Compare snapshots
|
||||||
|
sudo snapper -c root diff 41..42
|
||||||
|
|
||||||
|
# Show snapper config
|
||||||
|
sudo snapper -c root get-config
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Boot Recovery
|
||||||
|
|
||||||
|
If your system won't boot:
|
||||||
|
|
||||||
|
1. At limine boot menu, select a snapshot
|
||||||
|
2. System boots into that snapshot state
|
||||||
|
3. Once booted, you can:
|
||||||
|
- Fix the issue
|
||||||
|
- Roll back permanently with `snapper rollback`
|
||||||
|
- Create a new snapshot of the working state
|
||||||
|
|||||||
338
zsh/zshrc
338
zsh/zshrc
@@ -1,338 +0,0 @@
|
|||||||
# ============================================================================
|
|
||||||
# ADLee's ZSH Configuration
|
|
||||||
# ============================================================================
|
|
||||||
|
|
||||||
# Path to oh-my-zsh installation
|
|
||||||
export ZSH="$HOME/.oh-my-zsh"
|
|
||||||
|
|
||||||
# ============================================================================
|
|
||||||
# Theme Configuration
|
|
||||||
# ============================================================================
|
|
||||||
|
|
||||||
ZSH_THEME="adlee"
|
|
||||||
|
|
||||||
# ============================================================================
|
|
||||||
# Oh-My-Zsh Settings
|
|
||||||
# ============================================================================
|
|
||||||
|
|
||||||
# Update behavior
|
|
||||||
zstyle ':omz:update' mode reminder
|
|
||||||
zstyle ':omz:update' frequency 13
|
|
||||||
|
|
||||||
# Display red dots whilst waiting for completion
|
|
||||||
COMPLETION_WAITING_DOTS="true"
|
|
||||||
|
|
||||||
# History timestamp format
|
|
||||||
HIST_STAMPS="yyyy-mm-dd"
|
|
||||||
|
|
||||||
# ============================================================================
|
|
||||||
# Plugins
|
|
||||||
# ============================================================================
|
|
||||||
|
|
||||||
plugins=(
|
|
||||||
git
|
|
||||||
docker
|
|
||||||
docker-compose
|
|
||||||
kubectl
|
|
||||||
sudo
|
|
||||||
fzf
|
|
||||||
zsh-autosuggestions
|
|
||||||
zsh-syntax-highlighting
|
|
||||||
)
|
|
||||||
|
|
||||||
# Note: Install additional plugins with:
|
|
||||||
# git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
|
||||||
# git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
|
||||||
|
|
||||||
# ============================================================================
|
|
||||||
# Load Oh-My-Zsh
|
|
||||||
# ============================================================================
|
|
||||||
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
|
||||||
|
|
||||||
# ============================================================================
|
|
||||||
# User Configuration
|
|
||||||
# ============================================================================
|
|
||||||
|
|
||||||
# --- Environment Variables ---
|
|
||||||
|
|
||||||
export EDITOR='vim'
|
|
||||||
export VISUAL='vim'
|
|
||||||
export LANG=en_US.UTF-8
|
|
||||||
export LC_ALL=en_US.UTF-8
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
|
|
||||||
# --- Aliases ---
|
|
||||||
|
|
||||||
# Navigation
|
|
||||||
alias ..='cd ..'
|
|
||||||
alias ...='cd ../..'
|
|
||||||
alias ....='cd ../../..'
|
|
||||||
alias ~='cd ~'
|
|
||||||
|
|
||||||
# List files
|
|
||||||
if command -v eza &> /dev/null; then
|
|
||||||
alias ls='eza --icons'
|
|
||||||
alias ll='eza -lah --icons'
|
|
||||||
alias la='eza -a --icons'
|
|
||||||
alias lt='eza --tree --level=2 --icons'
|
|
||||||
else
|
|
||||||
alias ll='ls -lah'
|
|
||||||
alias la='ls -A'
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cat with syntax highlighting
|
|
||||||
if command -v batcat &> /dev/null; then
|
|
||||||
alias cat='batcat --paging=never'
|
|
||||||
alias bat='batcat'
|
|
||||||
elif command -v bat &> /dev/null; then
|
|
||||||
alias cat='bat --paging=never'
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Git shortcuts
|
|
||||||
alias g='git'
|
|
||||||
alias gs='git status'
|
|
||||||
alias ga='git add'
|
|
||||||
alias gc='git commit'
|
|
||||||
alias gp='git push'
|
|
||||||
alias gl='git pull'
|
|
||||||
alias gd='git diff'
|
|
||||||
alias gco='git checkout'
|
|
||||||
alias gb='git branch'
|
|
||||||
alias glog='git log --oneline --graph --decorate --all'
|
|
||||||
|
|
||||||
# Docker shortcuts
|
|
||||||
alias d='docker'
|
|
||||||
alias dc='docker-compose'
|
|
||||||
alias dps='docker ps'
|
|
||||||
alias dpa='docker ps -a'
|
|
||||||
alias di='docker images'
|
|
||||||
alias dex='docker exec -it'
|
|
||||||
|
|
||||||
# System shortcuts
|
|
||||||
alias reload='source ~/.zshrc'
|
|
||||||
alias zshconfig='vim ~/.zshrc'
|
|
||||||
alias themeconfig='vim ~/.oh-my-zsh/themes/adlee.zsh-theme'
|
|
||||||
alias h='history'
|
|
||||||
alias c='clear'
|
|
||||||
|
|
||||||
# Safe operations
|
|
||||||
alias rm='rm -i'
|
|
||||||
alias cp='cp -i'
|
|
||||||
alias mv='mv -i'
|
|
||||||
|
|
||||||
# Network
|
|
||||||
alias myip='curl ifconfig.me'
|
|
||||||
alias ports='netstat -tulanp'
|
|
||||||
|
|
||||||
# --- Functions ---
|
|
||||||
|
|
||||||
# Juuuust puuush it.
|
|
||||||
push-it() {
|
|
||||||
git add .
|
|
||||||
git commit -m "$1"
|
|
||||||
git push origin
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create directory and cd into it
|
|
||||||
mkcd() {
|
|
||||||
mkdir -p "$1" && cd "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Extract various archive formats
|
|
||||||
extract() {
|
|
||||||
if [[ -f "$1" ]]; then
|
|
||||||
case "$1" in
|
|
||||||
*.tar.bz2) tar xjf "$1" ;;
|
|
||||||
*.tar.gz) tar xzf "$1" ;;
|
|
||||||
*.bz2) bunzip2 "$1" ;;
|
|
||||||
*.rar) unrar x "$1" ;;
|
|
||||||
*.gz) gunzip "$1" ;;
|
|
||||||
*.tar) tar xf "$1" ;;
|
|
||||||
*.tbz2) tar xjf "$1" ;;
|
|
||||||
*.tgz) tar xzf "$1" ;;
|
|
||||||
*.zip) unzip "$1" ;;
|
|
||||||
*.Z) uncompress "$1" ;;
|
|
||||||
*.7z) 7z x "$1" ;;
|
|
||||||
*) echo "'$1' cannot be extracted via extract()" ;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
echo "'$1' is not a valid file"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Quick find file
|
|
||||||
ff() {
|
|
||||||
find . -type f -iname "*$1*"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Quick find directory (renamed to avoid conflict with fd tool)
|
|
||||||
fdir() {
|
|
||||||
find . -type d -iname "*$1*"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Quick backup
|
|
||||||
backup() {
|
|
||||||
cp "$1" "$1.backup-$(date +%Y%m%d-%H%M%S)"
|
|
||||||
}
|
|
||||||
|
|
||||||
# --- FZF Configuration ---
|
|
||||||
|
|
||||||
if command -v fzf &> /dev/null; then
|
|
||||||
if command -v fd &> /dev/null; then
|
|
||||||
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
|
|
||||||
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
|
||||||
fi
|
|
||||||
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'
|
|
||||||
bindkey '^R' fzf-history-widget
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- History Configuration ---
|
|
||||||
|
|
||||||
HISTSIZE=10000
|
|
||||||
SAVEHIST=10000
|
|
||||||
HISTFILE=~/.zsh_history
|
|
||||||
|
|
||||||
setopt SHARE_HISTORY
|
|
||||||
setopt APPEND_HISTORY
|
|
||||||
setopt EXTENDED_HISTORY
|
|
||||||
setopt HIST_IGNORE_ALL_DUPS
|
|
||||||
setopt HIST_FIND_NO_DUPS
|
|
||||||
setopt HIST_IGNORE_SPACE
|
|
||||||
|
|
||||||
# --- Key Bindings ---
|
|
||||||
|
|
||||||
bindkey "^[[1;5C" forward-word # Ctrl+Right
|
|
||||||
bindkey "^[[1;5D" backward-word # Ctrl+Left
|
|
||||||
bindkey "^[[H" beginning-of-line # Home
|
|
||||||
bindkey "^[[F" end-of-line # End
|
|
||||||
bindkey "^[[3~" delete-char # Delete
|
|
||||||
|
|
||||||
# --- Custom Widgets ---
|
|
||||||
|
|
||||||
# Alt+R to reload zsh config
|
|
||||||
reload-zsh() {
|
|
||||||
source ~/.zshrc
|
|
||||||
echo "✓ zsh configuration reloaded"
|
|
||||||
zle reset-prompt
|
|
||||||
}
|
|
||||||
zle -N reload-zsh
|
|
||||||
bindkey "^[r" reload-zsh
|
|
||||||
|
|
||||||
# Alt+G to show git status
|
|
||||||
git-status-widget() {
|
|
||||||
echo
|
|
||||||
git status
|
|
||||||
zle reset-prompt
|
|
||||||
}
|
|
||||||
zle -N git-status-widget
|
|
||||||
bindkey "^[g" git-status-widget
|
|
||||||
|
|
||||||
# ============================================================================
|
|
||||||
# Lazy-loaded Tools (for faster shell startup)
|
|
||||||
# ============================================================================
|
|
||||||
|
|
||||||
# --- NVM (lazy load) ---
|
|
||||||
# Only loads when you first use node, npm, nvm, or npx
|
|
||||||
export NVM_DIR="$HOME/.nvm"
|
|
||||||
|
|
||||||
_load_nvm() {
|
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
||||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create lazy-load wrappers
|
|
||||||
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
||||||
nvm() {
|
|
||||||
unfunction nvm node npm npx 2>/dev/null
|
|
||||||
_load_nvm
|
|
||||||
nvm "$@"
|
|
||||||
}
|
|
||||||
node() {
|
|
||||||
unfunction nvm node npm npx 2>/dev/null
|
|
||||||
_load_nvm
|
|
||||||
node "$@"
|
|
||||||
}
|
|
||||||
npm() {
|
|
||||||
unfunction nvm node npm npx 2>/dev/null
|
|
||||||
_load_nvm
|
|
||||||
npm "$@"
|
|
||||||
}
|
|
||||||
npx() {
|
|
||||||
unfunction nvm node npm npx 2>/dev/null
|
|
||||||
_load_nvm
|
|
||||||
npx "$@"
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Python virtualenvwrapper (lazy load) ---
|
|
||||||
export WORKON_HOME=$HOME/.virtualenvs
|
|
||||||
|
|
||||||
_load_virtualenvwrapper() {
|
|
||||||
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
|
|
||||||
[ -f /usr/local/bin/virtualenvwrapper.sh ] && source /usr/local/bin/virtualenvwrapper.sh
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then
|
|
||||||
workon() {
|
|
||||||
unfunction workon mkvirtualenv rmvirtualenv 2>/dev/null
|
|
||||||
_load_virtualenvwrapper
|
|
||||||
workon "$@"
|
|
||||||
}
|
|
||||||
mkvirtualenv() {
|
|
||||||
unfunction workon mkvirtualenv rmvirtualenv 2>/dev/null
|
|
||||||
_load_virtualenvwrapper
|
|
||||||
mkvirtualenv "$@"
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Rust cargo (only if exists) ---
|
|
||||||
[ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env"
|
|
||||||
|
|
||||||
# --- OS-Specific Configuration ---
|
|
||||||
|
|
||||||
case "$(uname -s)" in
|
|
||||||
Darwin*)
|
|
||||||
export HOMEBREW_NO_ANALYTICS=1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# --- Snapper Functions ---
|
|
||||||
|
|
||||||
if [[ -f "$HOME/.dotfiles/zsh/functions/snapper.zsh" ]]; then
|
|
||||||
source "$HOME/.dotfiles/zsh/functions/snapper.zsh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Smart Command Suggestions ---
|
|
||||||
|
|
||||||
if [[ -f "$HOME/.dotfiles/zsh/functions/smart-suggest.zsh" ]]; then
|
|
||||||
source "$HOME/.dotfiles/zsh/functions/smart-suggest.zsh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Command Palette (Ctrl+Space or Ctrl+P) ---
|
|
||||||
|
|
||||||
if [[ -f "$HOME/.dotfiles/zsh/functions/command-palette.zsh" ]]; then
|
|
||||||
source "$HOME/.dotfiles/zsh/functions/command-palette.zsh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Dotfiles Sync Check (on shell start) ---
|
|
||||||
|
|
||||||
if [[ "${DOTFILES_AUTO_SYNC_CHECK:-true}" == "true" ]]; then
|
|
||||||
# Quick async check for dotfiles updates
|
|
||||||
(dotfiles-sync.sh --auto 2>/dev/null &)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Vault Integration ---
|
|
||||||
|
|
||||||
# Source vault secrets into environment (if vault exists and has secrets)
|
|
||||||
if command -v vault.sh &>/dev/null && [[ -f "$HOME/.dotfiles/vault/secrets.enc" ]]; then
|
|
||||||
eval "$(vault.sh shell 2>/dev/null)" || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Local Configuration ---
|
|
||||||
|
|
||||||
[ -f ~/.zshrc.local ] && source ~/.zshrc.local
|
|
||||||
|
|
||||||
# ============================================================================
|
|
||||||
# End of Configuration
|
|
||||||
# ============================================================================
|
|
||||||
Reference in New Issue
Block a user