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`).
This commit is contained in:
1 parent
aa5708a28d
commit
a19ed0aec6
2 files changed
+32
-7
No files matched your search
@@ -37,6 +37,17 @@ The shell environment is modularized:
|
|||||||
| `gd` | `git diff` | Syntax-highlighted git diff via Delta. |
|
| `gd` | `git diff` | Syntax-highlighted git diff via Delta. |
|
||||||
| `gl` | `git log --oneline --graph --decorate` | Compact visual commit graph. |
|
| `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/`)
|
## 3. Modular Shell Scripts (`home/shell/`)
|
||||||
|
|||||||
+21
-7
@@ -85,10 +85,24 @@ copy_dir() {
|
|||||||
printf "%s" "$dir" | wl-copy
|
printf "%s" "$dir" | wl-copy
|
||||||
}
|
}
|
||||||
|
|
||||||
# 10. Shorthand Navigation Aliases
|
# 10. Shorthand Navigation Aliases (Dual 2-letter and mnemonic mapping)
|
||||||
cfg() { jump "$HOME/Config" "$1" 2; } # Quickly jump inside ~/Config modules
|
brain() { jump "$HOME/Brain" "$1" 2; } # Jump into ~/Brain
|
||||||
prj() { jump "$HOME/Projects" "$1"; } # Jump into local workspace projects
|
homelab() { jump "$HOME/Homelab" "$1" 2; } # Jump into ~/Homelab
|
||||||
lrn() { jump "/$HOME/Learn" "$1"; } # Jump to ~/Learn
|
conf() { jump "$HOME/Config" "$1" 2; } # Jump into ~/Config
|
||||||
dep() { jump "$HOME/Deployments" "$1"; } # Jump to Deployments folder
|
doc() { jump "$HOME/Documents" "$1" 2; } # Jump into ~/Documents
|
||||||
dl() { jump "$HOME/Downloads" "$1"; } # Jump to Downloads
|
dl() { jump "$HOME/Downloads" "$1" 2; } # Jump into ~/Downloads
|
||||||
med() { jump "/media" "$1"; } # Jump to /media mounted storage
|
pic() { jump "$HOME/Pictures" "$1" 2; } # Jump into ~/Pictures
|
||||||
|
pj() { jump "$HOME/Projects" "$1" 3; } # Jump into ~/Projects (depth 3)
|
||||||
|
|
||||||
|
# 2-Letter Fast Aliases
|
||||||
|
br() { brain "$@"; }
|
||||||
|
cf() { conf "$@"; }
|
||||||
|
dc() { doc "$@"; }
|
||||||
|
pi() { pic "$@"; }
|
||||||
|
hl() { homelab "$@"; }
|
||||||
|
|
||||||
|
# Convenience & Backward-Compatibility Aliases
|
||||||
|
docs() { doc "$@"; }
|
||||||
|
pict() { pic "$@"; }
|
||||||
|
cfg() { conf "$@"; }
|
||||||
|
prj() { pj "$@"; }
|
||||||
Reference in new issue
Block a user