🌐 peak Tutorial - Master Modal Browser Navigation

⌨️ First Things First - How to Scroll This Page:
Use these keys to navigate through this tutorial:
j = scroll down     k = scroll up     t = scroll up faster     g = scroll down faster

Welcome to peak! This tutorial will teach you how to use this terminal-based web browser with Vim-style modal controls. If you've used Vim, you'll feel right at home. If not, don't worry – we'll guide you through everything step by step.

peak uses modes to separate different types of interactions, making keyboard navigation efficient and powerful.

📋 Table of Contents

1. Understanding Modes

peak has four distinct modes, each designed for different tasks:

💡 Tip: The current mode is always shown in the status bar at the bottom of the screen. Press ESC in any mode to return to STANDARD mode.

🎯 Check Your Status Bar

Look at the bottom of your screen right now. You should see [S] indicating you're in STANDARD mode.

2. STANDARD Mode - Navigation & Commands

This is your home base. From STANDARD mode, you can navigate pages, manage bookmarks, and access all browser features with single-key commands.

Page Navigation

Try scrolling this page using j (down) and k (up). Get a feel for the rhythm!

URL & Page Management

Press u to open the URL dialog. Type a URL and press Enter to navigate. Try example.com!

Advanced Navigation

Developer & Advanced

Mode Switching

3. MOUSE Mode - Keyboard Mouse Control

MOUSE mode lets you control a virtual mouse cursor using your keyboard. This is perfect for clicking buttons, interacting with complex web apps, or when hint mode doesn't capture all clickable elements.

💡 Activation: Press e from STANDARD mode. A colored cursor will appear on screen. The color indicates speed mode.

Cursor Movement

Actions

Exit

Try entering MOUSE mode with e, moving the cursor with hjkl, and clicking this button:

Grid Mode

Grid mode divides the screen into a 3×3 grid. Press g in MOUSE mode to activate, then press one of these keys to jump:

q w e
a s d
z x c

Each key corresponds to a screen position. By default, these keys match your keyboard layout for easy memorization.

4. INSERT Mode - Text Input

INSERT mode is where all your keypresses go directly to the webpage. This is essential for filling out forms, typing in search boxes, and interacting with web applications.

💡 How to use: Press i from STANDARD mode. The status bar will show [I]. Now you can type normally in any form field.

🎯 Try It Now!

Below is a text input field. Follow these steps:

  1. Use MOUSE mode (e) to click the field below, or use your terminal mouse if available
  2. Press i to enter INSERT mode
  3. Type something:
  4. Press ESC to return to STANDARD mode
⚠️ Common Mistake: Forgetting you're in INSERT mode and trying to use navigation keys like j and k. They'll just type letters! Always check the status bar mode indicator.

5. VISUAL Mode - Text Selection

VISUAL mode lets you select and copy text from web pages using keyboard navigation.

💡 Activation: Press v from STANDARD mode. The status bar shows [V].

Selection Movement

Actions

Try selecting this text: Press 'v', navigate with 'hjkl', and press 'y' to copy! Then paste it somewhere to verify.

6. Advanced Features

Coordinate Click Mode

Coordinate click mode lets you click anywhere using exact pixel coordinates. Press f and a red crosshair appears in the center of the page.

💡 Usage: Press f. A red grid appears with letters A–Z along the top (columns) and left (rows). Type a column letter and a row letter (for example M,K) and press ENTER to click at their intersection. Press ESC to cancel.

🎯 Practice Links

Press f and click these links by their position:

Bookmarks

User Scripts

Inject custom JavaScript into web pages for enhanced functionality.

Example scripts are in the examples/ directory:

JavaScript Console

Press c to toggle the console. View page errors, warnings, and console.log() output. Navigate with j/k, exit with ESC.

Profile Modes

Configure in ~/.peak/browser.conf or use command-line flags:

Graphics Protocol

Choose rendering protocol in browser.conf or via command line:

7. Tips & Tricks

Workflow Optimization

💡 Quick Link Navigation: For pages with many links, use hint mode (f) instead of MOUSE mode. It's much faster!
💡 Form Filling: Use MOUSE mode to click the first field, then press i to enter INSERT mode. Fill the form, then ESC when done.
💡 Reading Articles: Use t and g for smooth scrolling through long articles. Much more comfortable than holding j!
💡 Quick Bookmarking: On a page you like? Just press d. Later press b to access all your bookmarks.

Common Workflows

Search Engine Workflow

  1. Press u to open URL dialog
  2. Type google.com (or your preferred search engine)
  3. Press Enter
  4. When page loads, press i for INSERT mode
  5. Type your search query
  6. Press ESC, then f to click search or first result

Article Reading Workflow

  1. Navigate to article using hint mode or URL
  2. (Optional) Press s and inject reader-mode.js for cleaner layout
  3. Use t/g to scroll smoothly
  4. Press v to select interesting quotes, y to copy
  5. Press d to bookmark if you want to return later

Performance Tips

💡 Graphics Protocol: If using kitty terminal, use --kitty flag for better performance. Otherwise use --sixel (default).
💡 Force Redraw: If the screen looks corrupted, press Z (capital Z) to force a full redraw.

Troubleshooting

⚠️ Terminal not displaying graphics? Make sure your terminal supports sixel (mlterm, xterm, wezterm, foot) or kitty protocol (kitty, ghostty, wezterm).
⚠️ Keys not working? Check your mode! In INSERT mode, navigation keys won't work. Press ESC to return to STANDARD mode.
⚠️ Hint mode not showing hints? Wait a moment for the page to fully render overlays. On complex pages, this might take a second or two.

🎓 Congratulations!

You've completed the peak tutorial! You now know:

💡 Next Steps: Practice makes perfect! Try browsing your favorite websites using only keyboard navigation. You'll be amazed at how fast it becomes!

🎯 Final Challenge

Without using your mouse at all:

  1. Press u and navigate to news.ycombinator.com
  2. Use hint mode (f) to open an article
  3. Scroll through it with t/g
  4. Select a quote with VISUAL mode (v) and copy it (y)
  5. Bookmark it (d)
  6. Go back (p) and open your bookmarks (b)

If you can do all this smoothly, you're officially a peak power user! 🚀

Happy browsing!
For more info, check ~/.peak/ or run peak --help