Skip to content

Commit d90f6c7

Browse files
committed
feat: add posts for Starship, zoxide/fzf, and Readline shortcuts to the curriculum
1 parent 7ce336e commit d90f6c7

4 files changed

Lines changed: 242 additions & 2 deletions

File tree

src/_data/curriculum.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
{
6464
"name": "Phase 9: Power User Extras",
6565
"slugs": [
66-
"starship"
66+
"starship",
67+
"readline",
68+
"zoxide-fzf"
6769
]
6870
},
6971
{

src/posts/readline.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
layout: base.njk
3+
title: "Keyboard Shortcuts (Readline)"
4+
excerpt: "The hidden shortcuts that make terminal pros look like wizards."
5+
tags: posts
6+
---
7+
8+
# Keyboard Shortcuts (Readline) ⌨️
9+
10+
Have you ever watched someone blast through the terminal, editing commands at lightning speed without reaching for the mouse? They aren't typing faster — they're using **Readline shortcuts**.
11+
12+
## What is Readline?
13+
14+
**[GNU Readline](https://tiswww.case.edu/php/chet/readline/rltop.html)** is a tiny, invisible library built into **Bash** (and many other terminal programs) that handles everything you type at the command line. It's the reason you can press `Up Arrow` to recall your last command or hit `Tab` to auto-complete a file name.
15+
16+
But `Up Arrow` and `Tab` are just the tip of the iceberg. Readline has dozens of keyboard shortcuts that most people never discover — and they work **everywhere**, not just in your shell. They work in `python`, `node`, `mysql`, and almost any interactive command-line tool.
17+
18+
> [!NOTE]
19+
> **Fish Shell Users**: Fish doesn't use GNU Readline internally — it has its own editor. However, Fish supports most of the same shortcuts listed here by default, so these habits will serve you well in either shell!
20+
21+
---
22+
23+
## ✂️ The Essential Shortcuts
24+
25+
These are the shortcuts you'll use every single day. They all work without a mouse and are dramatically faster than using the arrow keys.
26+
27+
### Moving the Cursor
28+
29+
| Shortcut | What it does |
30+
| :--- | :--- |
31+
| **`Ctrl+A`** | Jump to the **beginning** of the line |
32+
| **`Ctrl+E`** | Jump to the **end** of the line |
33+
| **`Alt+F`** | Jump forward one **word** |
34+
| **`Alt+B`** | Jump backward one **word** |
35+
36+
> [!TIP]
37+
> **Think of it this way:** `A` = stArt, `E` = End, `F` = Forward, `B` = Backward.
38+
39+
### Deleting Text
40+
41+
| Shortcut | What it does |
42+
| :--- | :--- |
43+
| **`Ctrl+W`** | Delete the **word** before the cursor |
44+
| **`Ctrl+K`** | Delete everything **after** the cursor (to end of line) |
45+
| **`Ctrl+U`** | Delete everything **before** the cursor (to start of line) |
46+
| **`Alt+D`** | Delete the word **after** the cursor |
47+
48+
### The "Undo" and "Paste"
49+
50+
Here's the secret most people don't know: when you delete text with `Ctrl+W`, `Ctrl+K`, or `Ctrl+U`, the deleted text isn't gone — it's saved in a clipboard called the **kill ring**.
51+
52+
| Shortcut | What it does |
53+
| :--- | :--- |
54+
| **`Ctrl+Y`** | **Paste** (\"yank\") the last deleted text back |
55+
| **`Ctrl+_`** | **Undo** the last edit |
56+
57+
---
58+
59+
## 🎯 Real-World Examples
60+
61+
### Fixing a Typo at the Start of a Long Command
62+
You just typed a monster command and realized you forgot `sudo`:
63+
```
64+
systemctl enable --now sshd
65+
```
66+
Instead of pressing `Home`, then typing `sudo `:
67+
- **`Ctrl+A`** → jump to the start
68+
- Type `sudo ` → done!
69+
70+
### Editing Your Last Command Instead of Retyping It
71+
You just copied a file to the wrong place:
72+
```bash
73+
cp ~/Downloads/wallpaper.png ~/Pictures/screenshots/
74+
```
75+
You actually meant to put it in `~/Pictures/wallpapers/`. Instead of retyping the whole thing:
76+
- Press **`Up Arrow`** to recall the command
77+
- Press **`Ctrl+W`** to delete the last word (`~/Pictures/screenshots/`)
78+
- Type the correct destination: `~/Pictures/wallpapers/`
79+
80+
### Grabbing the Last Argument with `Alt+.`
81+
**`Alt+.`** pastes the **last argument** of the previous command. This is a huge time-saver whenever you're working with the same file or directory across multiple commands.
82+
83+
You just checked a config file:
84+
```bash
85+
cat /etc/NetworkManager/conf.d/wifi_backend.conf
86+
```
87+
Now you want to edit it. Type `nano`, then hit **`Alt+.`**:
88+
```bash
89+
nano /etc/NetworkManager/conf.d/wifi_backend.conf
90+
```
91+
No retyping that long path! This works just as well for directories — after running `mkdir -p ~/Games/emulation/roms/gba`, you can type `cd` and hit **`Alt+.`** to jump straight into the new directory.
92+
93+
### Wiping a Command You Changed Your Mind About
94+
You're halfway through a command and decide you don't want to run it:
95+
- **`Ctrl+C`** cancels and gives you a fresh prompt
96+
- Or **`Ctrl+U`** clears the line but keeps it in the kill ring in case you want it back with **`Ctrl+Y`**
97+
98+
---
99+
100+
## 🧠 The Cheat Sheet
101+
102+
Here's everything in one place for quick reference:
103+
104+
| Category | Shortcut | Action |
105+
| :--- | :--- | :--- |
106+
| **Move** | `Ctrl+A` / `Ctrl+E` | Start / End of line |
107+
| **Move** | `Alt+F` / `Alt+B` | Forward / Back one word |
108+
| **Delete** | `Ctrl+W` | Delete word before cursor |
109+
| **Delete** | `Ctrl+U` / `Ctrl+K` | Delete to start / end of line |
110+
| **Delete** | `Alt+D` | Delete word after cursor |
111+
| **Paste** | `Ctrl+Y` | Yank (paste) last deleted text |
112+
| **Undo** | `Ctrl+_` | Undo last edit |
113+
| **History** | `Up` / `Down` | Previous / next command |
114+
| **History** | `Ctrl+R` | Reverse search through history |
115+
| **Magic** | `Alt+.` | Insert last argument of previous command |
116+
| **Cancel** | `Ctrl+C` | Abort current command |
117+
| **Clear** | `Ctrl+L` | Clear the screen (same as `clear`) |
118+
119+
---
120+
121+
These shortcuts take about a day to become muscle memory, and once they click, you'll wonder how you ever lived without them. The terminal stops feeling like a text box and starts feeling like an instrument.
122+
123+
{% next_chapter %}

src/posts/starship.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ By default, Starship looks great, but the real magic is in the **Presets**.
8383
8484
---
8585

86-
Now that your terminal looks like it belongs in the future, you've completed the entire curriculum! Head over to our final chapter for a curated list of communities, guides, and creators to keep your journey going.
86+
Now that your terminal looks like it belongs in the future, let's make it *work* like it belongs there too.
8787

8888
{% next_chapter %}

src/posts/zoxide-fzf.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
layout: base.njk
3+
title: "Terminal Superpowers (zoxide & fzf)"
4+
excerpt: "Navigate like a pro and fuzzy-find anything in seconds."
5+
tags: posts
6+
---
7+
8+
# Terminal Superpowers (zoxide & fzf) ⚡
9+
10+
You've made your terminal beautiful with {{ collections.posts | chapterLink('starship') | safe }}. Now let's make it *smart*. These two tools will fundamentally change how you interact with the command line — and they're especially powerful on the Steam Deck, where navigating deep, hidden paths is a daily struggle.
11+
12+
## 🚀 zoxide — "Your Terminal Remembers"
13+
14+
Ever get tired of typing out full paths to get where you want to go?
15+
```bash
16+
cd /home/deck/.local/share/Steam/steamapps/compatdata/
17+
```
18+
19+
What if you could just type:
20+
```bash
21+
z compat
22+
```
23+
24+
That's **[zoxide](https://github.com/ajeetdsouza/zoxide)**. It's a smarter replacement for `cd` that *learns* which directories you visit most often. The more you use it, the smarter it gets.
25+
26+
### How it Works
27+
Every time you navigate to a folder (using `cd` or `z`), zoxide silently records it in a tiny database. When you type `z` followed by *any part* of a directory name you've visited before, it fuzzy-matches against your history and jumps to the best result.
28+
29+
- `z down` → jumps to `/home/deck/Downloads`
30+
- `z compat` → jumps to `.local/share/Steam/steamapps/compatdata`
31+
- `z my-ubuntu` → jumps to wherever your Distrobox home lives
32+
33+
The key thing to understand: **zoxide only knows about directories you've already visited.** The first time you navigate somewhere, use `cd` or `z` with the full path. After that, zoxide remembers it and you can use a short keyword forever.
34+
35+
### Installing zoxide
36+
37+
#### Via Homebrew (from {{ collections.posts | chapterLink('homebrew') | safe }}):
38+
```bash
39+
brew install zoxide
40+
```
41+
42+
#### Via Nix (from {{ collections.posts | chapterLink('nix') | safe }}):
43+
```bash
44+
nix profile install nixpkgs#zoxide
45+
```
46+
47+
### Setting it Up
48+
After installing, you need to tell your shell to use it.
49+
50+
**For Bash** — add to `~/.bashrc`:
51+
```bash
52+
eval "$(zoxide init bash)"
53+
```
54+
55+
**For Fish** — add to `~/.config/fish/config.fish`:
56+
```bash
57+
zoxide init fish | source
58+
```
59+
60+
> [!TIP]
61+
> Once zoxide is set up, you can also use `zi` (zoxide interactive) to get a full menu of your most-visited directories. This is incredible for exploring your Steam library's messy folder structure!
62+
63+
---
64+
65+
## 🔍 fzf — "Fuzzy-Find Everything"
66+
67+
**[fzf](https://github.com/junegunn/fzf)** is a general-purpose fuzzy finder. It lets you interactively search through *anything* — files, folders, command history, running processes — by just typing a few characters.
68+
69+
### The Killer Feature: History Search
70+
By default, pressing `Up Arrow` in your terminal scrolls through commands one at a time. With fzf installed, you can press **`Ctrl+R`** and get an instant, searchable list of every command you've ever typed.
71+
72+
Start typing `podman` and it will instantly filter down to every Podman command you've ever run. Select one and hit `Enter` to run it again. No more scrolling through hundreds of commands!
73+
74+
### Installing fzf
75+
76+
#### Via Homebrew:
77+
```bash
78+
brew install fzf
79+
```
80+
81+
#### Via Nix:
82+
```bash
83+
nix profile install nixpkgs#fzf
84+
```
85+
86+
### More fzf Tricks
87+
88+
Once installed, fzf supercharges your terminal in several ways:
89+
90+
- **`Ctrl+R`**: Fuzzy search your command history.
91+
- **`Ctrl+T`**: Fuzzy search for a file in the current directory and paste its path.
92+
- **`Alt+C`**: Fuzzy search for a directory and `cd` into it.
93+
94+
### Example: Finding a Mod File Instantly
95+
Imagine you downloaded a mod somewhere in your home folder but can't remember where. Instead of clicking through folders in Dolphin, just type:
96+
97+
```bash
98+
find ~ -name "*.pak" | fzf
99+
```
100+
101+
This searches your entire home directory for `.pak` files and lets you interactively filter the results. Select the file you want and its full path is printed — ready to copy!
102+
103+
---
104+
105+
## 🤝 Better Together
106+
107+
The real magic happens when zoxide and fzf are both installed. zoxide can use fzf as its interactive picker, which means `zi` (zoxide interactive) gives you a beautiful fuzzy-searchable list of all your frequently visited directories.
108+
109+
Both tools are lightweight (they're built in Rust 🦀), install in seconds, and work with both Bash and Fish. Once you've used them for a day, plain `cd` will feel like going back to dial-up.
110+
111+
---
112+
113+
Now that your terminal is beautiful, smart, *and* fast, you've truly completed the power user journey!
114+
115+
{% next_chapter %}

0 commit comments

Comments
 (0)