Files
nixos-config/docs/reference/shell.md
T
kiskaadee a19ed0aec6 feat(shell): expand directory navigation helpers with 2-letter shortcuts and mnemonic aliases
- Add documentation table for directory navigation jumps in `docs/reference/shell.md`.
- Refactor `home/shell/jump.sh` to provide dual 2-letter shortcuts (`br`, `cf`, `dc`, `pi`, `pj`, `hl`) and full mnemonic functions (`homelab`, `brain`, `conf`, `doc`, `pic`).
- Retain backward-compatibility mappings for legacy shorthand aliases (`cfg`, `prj`, `docs`, `pict`).
2026-09-14 15:55:32 -05:00

71 lines
2.7 KiB
Markdown

# 🐚 Shell & CLI Environment Reference
This document catalogs the interactive Bash shell configuration, Starship prompt integration, and custom helper scripts managed in `home/shell.nix` and `home/shell/`.
---
## 1. Shell Configuration Architecture
The shell environment is modularized:
- **`home/shell.nix`**: Core Home Manager bash module, aliases, environment exports, and tool integrations (Direnv, Starship, Fastfetch).
- **`home/shell/`**: Domain-specific sourced shell scripts:
- `git.sh`: Git helper functions and branch utilities.
- `jump.sh`: Directory navigation and quick jumping.
- `pdf.sh`: PDF compilation, viewing, and OCR helpers.
- `quicklinks.sh`: Shortcuts to primary project directories.
- `todo.sh`: Lightweight terminal task tracking.
- `wayland.sh`: Wayland session environment variables.
---
## 2. Shell Aliases & Shortcuts
### System & Navigation
| Alias | Target Command | Purpose |
| :--- | :--- | :--- |
| `c` | `clear` | Clear terminal scrollback. |
| `q` | `exit` | Close shell session. |
| `ls` | `eza --icons` | Modern directory listing. |
| `ll` | `eza -la --icons` | Detailed directory listing. |
| `tree` | `eza --tree --icons` | Directory tree visualization. |
| `cat` | `bat --paging=never` | Syntax-highlighted file viewing. |
### Git & Workflows
| Alias | Target Command | Purpose |
| :--- | :--- | :--- |
| `gs` | `git status` | Quick working tree status. |
| `gd` | `git diff` | Syntax-highlighted git diff via Delta. |
| `gl` | `git log --oneline --graph --decorate` | Compact visual commit graph. |
### Directory Navigation Jumps (`home/shell/jump.sh`)
| 2-Letter | Word Alias | Target Directory | Description |
| :--- | :--- | :--- | :--- |
| `br` | `brain` | `~/Brain` | Second brain knowledge base. |
| `cf` | `conf` / `cfg` | `~/Config` | Declarative NixOS configuration. |
| `dc` | `doc` / `docs` | `~/Documents` | Personal documents. |
| `dl` | `dl` | `~/Downloads` | Downloads folder. |
| `pi` | `pic` / `pict` | `~/Pictures` | Wallpapers, images, screenshots. |
| `pj` | `pj` / `prj` | `~/Projects` | Local workspace for project repositories. |
| `hl` | `hl` / `homelab` | `~/Homelab` | Local workspace for homelab repositories. |
---
## 3. Modular Shell Scripts (`home/shell/`)
All files in `home/shell/*.sh` are automatically sourced during interactive bash startup:
```bash
for script in ~/.config/bash/*.sh; do
[ -r "$script" ] && source "$script"
done
```
### Adding a New Shell Extension
To add new bash functions or aliases:
1. Create a new `.sh` file under `home/shell/<topic>.sh`.
2. Add the source link in `home/shell.nix`:
```nix
home.file.".config/bash/<topic>.sh".source = ./shell/<topic>.sh;
```
3. Rebuild and restart the shell.