From 03c227143b67a18e391ef43597fc39ae1066d177 Mon Sep 17 00:00:00 2001 From: Godruoyi Date: Thu, 5 Feb 2026 10:32:18 +0800 Subject: [PATCH 1/2] feat: add 8 tips from Zed v0.222.2 release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add valuable tips from Zed v0.222.2 stable release (published 2026-02-04): Image & UI Features: - image-viewer-zoom-pan: Zoom and pan in image viewer with scroll-wheel and toolbar (#43944) - terminal-tab-rename: Rename terminal tabs via right-click or double-click (#45800) AI/Agent Features: - agent-context-menu: Mouse-friendly context menu in agent panel (#47768) Vim Features: - vim-relative-line-jump: Relative line jumping with +/-/f/b syntax (#46932) - vim-gdefault-setting: Make /g default for substitutions (#47664) Navigation & Editing: - syntax-node-selection: Extend selections to syntax node boundaries (#47571) File Handling: - reopen-with-encoding: Fix garbled text by selecting correct encoding (#46553) - hot-exit-empty-workspaces: Restore unsaved files in empty workspaces (#46557) All tips include PR references, media URLs where available, and clear practical examples. 🤖 Generated with Claude Code Co-Authored-By: Claude Sonnet 4.5 --- tips/agent-context-menu.mdx | 42 ++++++++++++++++++++ tips/hot-exit-empty-workspaces.mdx | 44 +++++++++++++++++++++ tips/image-viewer-zoom-pan.mdx | 45 ++++++++++++++++++++++ tips/reopen-with-encoding.mdx | 53 +++++++++++++++++++++++++ tips/syntax-node-selection.mdx | 53 +++++++++++++++++++++++++ tips/terminal-tab-rename.mdx | 42 ++++++++++++++++++++ tips/vim-gdefault-setting.mdx | 62 ++++++++++++++++++++++++++++++ tips/vim-relative-line-jump.mdx | 55 ++++++++++++++++++++++++++ 8 files changed, 396 insertions(+) create mode 100644 tips/agent-context-menu.mdx create mode 100644 tips/hot-exit-empty-workspaces.mdx create mode 100644 tips/image-viewer-zoom-pan.mdx create mode 100644 tips/reopen-with-encoding.mdx create mode 100644 tips/syntax-node-selection.mdx create mode 100644 tips/terminal-tab-rename.mdx create mode 100644 tips/vim-gdefault-setting.mdx create mode 100644 tips/vim-relative-line-jump.mdx diff --git a/tips/agent-context-menu.mdx b/tips/agent-context-menu.mdx new file mode 100644 index 0000000..f2c839c --- /dev/null +++ b/tips/agent-context-menu.mdx @@ -0,0 +1,42 @@ +--- +title: Agent Context Menu for Quick Additions +subtitle: Add context to agent with mouse-friendly dropdown menu +category: ai +difficulty: beginner +tags: + - agent + - context + - ui +prUrl: https://github.com/zed-industries/zed/pull/47768 +mediaType: image +mediaUrl: https://github.com/user-attachments/assets/551686ba-4629-4317-9177-1e942512a23c +--- + +The agent panel now includes a **context menu** accessed via the `+` button, making it easier to add context with your mouse instead of typing `@` mentions. + +## What's in the Menu + +The `+` dropdown displays all available context options: +- **@mentions**: Files, diagnostics, selections, etc. +- **Images**: Attach screenshots or images +- **Selections**: Include selected code +- **Future features**: Skills and custom context (coming soon) + +## How to Use + +1. Click the `+` button in the agent message editor +2. Browse available context options in the dropdown +3. Select the context you want to add +4. Context is automatically inserted into your message + +All menu options are also available by typing `@` in the message editor. + +## Why This Matters + +**Discoverability**: See all available context types without memorizing `@` commands. + +**Mouse-friendly**: Add context without switching to keyboard. + +**Visual feedback**: Preview what context is available before adding. + +This menu serves as foundation for upcoming features like custom skills and advanced context management. diff --git a/tips/hot-exit-empty-workspaces.mdx b/tips/hot-exit-empty-workspaces.mdx new file mode 100644 index 0000000..439d49d --- /dev/null +++ b/tips/hot-exit-empty-workspaces.mdx @@ -0,0 +1,44 @@ +--- +title: Hot-Exit for Empty Workspaces +subtitle: Unsaved files in empty workspaces now restore on startup +category: productivity +difficulty: beginner +tags: + - workspace + - autosave + - workflow +prUrl: https://github.com/zed-industries/zed/pull/46557 +--- + +Empty workspaces (without folders) now support **hot-exit**, automatically restoring unsaved files like drafts and single files when you restart Zed. + +## What This Means + +Previously, closing Zed with unsaved files in an empty workspace would lose those files. Now they're preserved and restored on next launch. + +**Protected content:** +- Unsaved draft files +- Single files opened without a project folder +- Scratch buffers with content + +Empty workspaces are identified by `workspace_id` rather than file paths, allowing multiple empty workspaces to coexist and restore independently. + +## How It Works + +No configuration needed - hot-exit is automatic: + +1. Open Zed without a project folder +2. Create or edit files without saving +3. Close Zed +4. Reopen Zed +5. Your unsaved work is restored + +## Why This Matters + +**No lost work**: Close Zed confidently knowing unsaved files will return. + +**Scratch workflow**: Use Zed for quick notes and drafts without worrying about saving. + +**Session continuity**: Pick up exactly where you left off, even in empty workspaces. + +Perfect for users who frequently work with single files or use Zed as a quick scratchpad without opening project folders. diff --git a/tips/image-viewer-zoom-pan.mdx b/tips/image-viewer-zoom-pan.mdx new file mode 100644 index 0000000..47cd059 --- /dev/null +++ b/tips/image-viewer-zoom-pan.mdx @@ -0,0 +1,45 @@ +--- +title: Zoom and Pan in Image Viewer +subtitle: Navigate large images with scroll-wheel zoom and click-drag panning +category: productivity +difficulty: beginner +tags: + - image-viewer + - navigation + - shortcuts +prUrl: https://github.com/zed-industries/zed/pull/43944 +mediaType: video +mediaUrl: https://github.com/user-attachments/assets/855bafe8-fdc2-4945-9bfb-e48382264806 +--- + +Zed's image viewer now supports **zooming and panning** to help you inspect images in detail. Use scroll-wheel zoom, toolbar controls, or keyboard shortcuts to navigate large images efficiently. + +## Available Actions + +**Zoom Controls:** +- Scroll wheel + modifier key to zoom in/out +- Toolbar buttons for zoom in/out +- `zoom-to-actual` - View at 100% size +- `fit-to-view` - Fit entire image in viewport +- `reset` - Reset zoom level + +**Panning:** +- Click and drag to pan around zoomed images +- Zoom percentage overlay shows current zoom level + +## Why This Matters + +**Image inspection**: Examine design details, screenshots, or diagrams closely. + +**Navigation**: Easily move around large images without scrolling. + +**Workflow efficiency**: Quick zoom controls make image review faster. + +## How to Use + +1. Open any image file in Zed +2. Use scroll wheel while holding modifier key to zoom +3. Click and drag to pan around the zoomed image +4. Use toolbar controls or command palette for zoom actions + +The zoom percentage overlay appears automatically to show your current zoom level. diff --git a/tips/reopen-with-encoding.mdx b/tips/reopen-with-encoding.mdx new file mode 100644 index 0000000..c92bf79 --- /dev/null +++ b/tips/reopen-with-encoding.mdx @@ -0,0 +1,53 @@ +--- +title: Reopen Files with Different Encoding +subtitle: Fix garbled text by selecting the correct encoding from status bar +category: productivity +difficulty: beginner +tags: + - encoding + - files + - internationalization +prUrl: https://github.com/zed-industries/zed/pull/46553 +--- + +Fix **garbled text** caused by incorrect encoding detection by using the "Reopen with Encoding" feature. Select from Shift JIS, EUC-JP, UTF-16LE, and other encodings to properly display your files. + +## How to Use + +**Via Status Bar (Click):** +1. Click the encoding indicator in the status bar (e.g., "UTF-8") +2. Select desired encoding from the picker +3. File reloads with the new encoding + +**Via Keyboard Shortcut:** +- macOS: `Cmd-K N` +- Linux/Windows: `Ctrl-K N` + +**Via Command Palette:** +- Search for "Reopen with Encoding" + +## Available Encodings + +The picker includes common encodings: +- UTF-8, UTF-16LE, UTF-16BE +- Shift JIS (Japanese) +- EUC-JP (Japanese) +- GB2312, GBK (Chinese) +- And many more... + +## Why This Matters + +**Fix mojibake**: Resolve garbled characters in legacy files. + +**International files**: Properly display files created with different system encodings. + +**BOM handling**: Automatically handles byte order marks (BOM) when switching encodings. + +## Limitations + +Currently works for **local files only**. The feature is disabled when: +- In collaboration sessions (shared projects) +- Connected to remote servers (SSH/WSL) +- File has unsaved changes (to prevent data loss) + +When switching back to UTF-8, BOMs are properly detected and consumed to restore original file state. diff --git a/tips/syntax-node-selection.mdx b/tips/syntax-node-selection.mdx new file mode 100644 index 0000000..c4560fa --- /dev/null +++ b/tips/syntax-node-selection.mdx @@ -0,0 +1,53 @@ +--- +title: Extend Selection to Syntax Nodes +subtitle: Select to syntax node boundaries for precise code selection +category: navigation +difficulty: intermediate +tags: + - selection + - editing + - navigation +prUrl: https://github.com/zed-industries/zed/pull/47571 +--- + +Use **syntax node selection commands** to extend your selection to the start or end of larger syntax nodes, making it easy to select complete code structures precisely. + +## Available Commands + +Two new commands extend selections to syntax boundaries: + +- `editor: select to start of larger syntax node` - Extend selection backward to syntax node start +- `editor: select to end of larger syntax node` - Extend selection forward to syntax node end + +These complement the existing `move to {start,end} of larger syntax node` commands, but extend selections instead of moving the cursor. + +## How to Use + +1. Place cursor in your code +2. Run one of the selection commands via command palette +3. Selection extends to the nearest syntax node boundary +4. Repeat to expand to larger nodes + +## Setup Keybindings + +Add to your `keymap.json`: + +```json +{ + "context": "Editor", + "bindings": { + "alt-shift-[": "editor::SelectToStartOfLargerSyntaxNode", + "alt-shift-]": "editor::SelectToEndOfLargerSyntaxNode" + } +} +``` + +## Why This Matters + +**Precise selection**: Select exactly to code structure boundaries (functions, blocks, expressions). + +**Structural editing**: Work with code semantically rather than by lines or words. + +**Emacs-like workflow**: Similar to Emacs `mark-sexp` for S-expression selection. + +Perfect for structural code refactoring and editing operations that need to respect syntax boundaries. diff --git a/tips/terminal-tab-rename.mdx b/tips/terminal-tab-rename.mdx new file mode 100644 index 0000000..35ab2d4 --- /dev/null +++ b/tips/terminal-tab-rename.mdx @@ -0,0 +1,42 @@ +--- +title: Rename Terminal Tabs +subtitle: Organize terminals by renaming tabs via right-click or double-click +category: productivity +difficulty: beginner +tags: + - terminal + - organization + - workflow +prUrl: https://github.com/zed-industries/zed/pull/45800 +mediaType: video +mediaUrl: https://github.com/user-attachments/assets/be81a95b-1f64-4ebd-94e4-7cfe6a1e9ddb +--- + +Keep your terminal sessions organized by **renaming terminal tabs**. Give each terminal a meaningful name to quickly identify different tasks like "server", "tests", or "git". + +## How to Rename + +**Right-click method:** +1. Right-click on any terminal tab +2. Select "Rename" from context menu +3. Enter new name and press Enter + +**Double-click method:** +1. Double-click on the terminal tab title +2. Enter new name and press Enter + +## Why This Matters + +**Organization**: Distinguish between multiple terminal sessions at a glance. + +**Workflow clarity**: Name terminals by their purpose (e.g., "npm run dev", "docker logs"). + +**Context switching**: Quickly find the right terminal when juggling multiple tasks. + +## Example Use Cases + +- Name terminals by project component: "frontend", "backend", "database" +- Label by task type: "tests", "build", "deploy" +- Identify long-running processes: "dev server", "file watcher" + +Terminal tab names persist within your session, making it easier to maintain context across your workflow. diff --git a/tips/vim-gdefault-setting.mdx b/tips/vim-gdefault-setting.mdx new file mode 100644 index 0000000..963c6b1 --- /dev/null +++ b/tips/vim-gdefault-setting.mdx @@ -0,0 +1,62 @@ +--- +title: Vim Global Substitution Default +subtitle: Make /g the default for substitute commands with vim.gdefault +category: vim +difficulty: intermediate +tags: + - vim + - substitution + - settings +prUrl: https://github.com/zed-industries/zed/pull/47664 +--- + +Enable **vim.gdefault** to make `/g` (replace all matches in a line) the default behavior for Vim substitute commands, eliminating the need to type `/g` every time. + +## How It Works + +With `vim.gdefault` enabled, the `/g` flag behavior is inverted: + +| Command | gdefault ON | gdefault OFF | +|---------|-------------|--------------| +| `:s///` | Replace all | Replace one | +| `:s///g` | Replace one | Replace all | +| `:s///gg` | Replace all | Replace one | + +## Configuration + +Add to your `settings.json`: + +```json +{ + "vim": { + "gdefault": true + } +} +``` + +Or use Vim commands in editor: +- `:set gdefault` (short: `:set gd`) - Enable +- `:set nogdefault` (short: `:set nogd`) - Disable + +## Why This Matters + +**Efficiency**: Most substitutions replace all matches - make it the default. + +**Muscle memory**: If you're used to Vim with `gdefault`, maintain your workflow. + +**Less typing**: Skip `/g` on every substitute command. + +## Example + +Without gdefault: +```vim +:s/foo/bar/g " Need /g to replace all +``` + +With gdefault: +```vim +:s/foo/bar " Replaces all by default +:s/foo/bar/g " Add /g to replace only first match +``` + +This setting is especially useful for users transitioning from Vim/Neovim where they've relied on `gdefault` for years. diff --git a/tips/vim-relative-line-jump.mdx b/tips/vim-relative-line-jump.mdx new file mode 100644 index 0000000..da012b4 --- /dev/null +++ b/tips/vim-relative-line-jump.mdx @@ -0,0 +1,55 @@ +--- +title: Vim Relative Line Jumping +subtitle: Jump to lines relative to cursor position with +/- syntax +category: vim +difficulty: intermediate +tags: + - vim + - navigation + - shortcuts +prUrl: https://github.com/zed-industries/zed/pull/46932 +mediaType: video +mediaUrl: https://github.com/user-attachments/assets/395c0e7b-8ac1-48c8-a39e-5ade4f9206ec +--- + +The go-to-line action now supports **relative line jumping**, allowing you to jump to lines relative to your current cursor position using Vim/Neovim syntax. + +## Supported Syntax + +When using go-to-line with relative mode enabled: + +- `5` → jump 5 lines down +- `-3` or `b3` → jump 3 lines up +- `+10` or `f10` → jump 10 lines forward +- `0` → stay on current line + +Both `-` and `b` work for backward jumps, `+` and `f` for forward jumps. + +## Setup + +Add a keybinding to your `keymap.json`: + +```json +{ + "context": "VimControl && !menu", + "bindings": { + "ctrl-j": ["go_to_line::Toggle", {"relative": true}] + } +} +``` + +## How to Use + +1. Press your configured keybinding (e.g., `Ctrl-J`) +2. Type the relative line number (`5`, `-3`, `b10`, etc.) +3. Press Enter to jump + +## Why This Matters + +**Vim familiarity**: Matches Vim/Neovim's relative line jump behavior. + +**Efficient navigation**: Jump to nearby lines without calculating absolute line numbers. + +**Visual mode friendly**: Works with relative line numbers display for quick jumps. + +Perfect for Vim users who rely on relative line numbers and want fast vertical navigation. From 3676f39a07e0f4e25620804f76e9854f52a332ff Mon Sep 17 00:00:00 2001 From: Github action Date: Thu, 5 Feb 2026 02:34:47 +0000 Subject: [PATCH 2/2] chore: auto-add metadata fields [auto-metadata] --- tips/agent-context-menu.mdx | 8 ++++++-- tips/hot-exit-empty-workspaces.mdx | 6 +++++- tips/image-viewer-zoom-pan.mdx | 8 ++++++-- tips/reopen-with-encoding.mdx | 6 +++++- tips/syntax-node-selection.mdx | 6 +++++- tips/terminal-tab-rename.mdx | 8 ++++++-- tips/vim-gdefault-setting.mdx | 6 +++++- tips/vim-relative-line-jump.mdx | 8 ++++++-- 8 files changed, 44 insertions(+), 12 deletions(-) diff --git a/tips/agent-context-menu.mdx b/tips/agent-context-menu.mdx index f2c839c..f42edc5 100644 --- a/tips/agent-context-menu.mdx +++ b/tips/agent-context-menu.mdx @@ -7,9 +7,13 @@ tags: - agent - context - ui -prUrl: https://github.com/zed-industries/zed/pull/47768 +prUrl: 'https://github.com/zed-industries/zed/pull/47768' mediaType: image -mediaUrl: https://github.com/user-attachments/assets/551686ba-4629-4317-9177-1e942512a23c +mediaUrl: 'https://cat.zed.tips/2026-02-05/agent-context-menu-e38c2ff5.png' +publishedAt: '2026-02-05' +updatedAt: '2026-02-05' +author: godruoyi +authorUrl: 'https://github.com/godruoyi' --- The agent panel now includes a **context menu** accessed via the `+` button, making it easier to add context with your mouse instead of typing `@` mentions. diff --git a/tips/hot-exit-empty-workspaces.mdx b/tips/hot-exit-empty-workspaces.mdx index 439d49d..4aba636 100644 --- a/tips/hot-exit-empty-workspaces.mdx +++ b/tips/hot-exit-empty-workspaces.mdx @@ -7,7 +7,11 @@ tags: - workspace - autosave - workflow -prUrl: https://github.com/zed-industries/zed/pull/46557 +prUrl: 'https://github.com/zed-industries/zed/pull/46557' +publishedAt: '2026-02-05' +updatedAt: '2026-02-05' +author: godruoyi +authorUrl: 'https://github.com/godruoyi' --- Empty workspaces (without folders) now support **hot-exit**, automatically restoring unsaved files like drafts and single files when you restart Zed. diff --git a/tips/image-viewer-zoom-pan.mdx b/tips/image-viewer-zoom-pan.mdx index 47cd059..28497d5 100644 --- a/tips/image-viewer-zoom-pan.mdx +++ b/tips/image-viewer-zoom-pan.mdx @@ -7,9 +7,13 @@ tags: - image-viewer - navigation - shortcuts -prUrl: https://github.com/zed-industries/zed/pull/43944 +prUrl: 'https://github.com/zed-industries/zed/pull/43944' mediaType: video -mediaUrl: https://github.com/user-attachments/assets/855bafe8-fdc2-4945-9bfb-e48382264806 +mediaUrl: 'https://cat.zed.tips/2026-02-05/image-viewer-zoom-pan-0b083855.mp4' +publishedAt: '2026-02-05' +updatedAt: '2026-02-05' +author: godruoyi +authorUrl: 'https://github.com/godruoyi' --- Zed's image viewer now supports **zooming and panning** to help you inspect images in detail. Use scroll-wheel zoom, toolbar controls, or keyboard shortcuts to navigate large images efficiently. diff --git a/tips/reopen-with-encoding.mdx b/tips/reopen-with-encoding.mdx index c92bf79..20f0f9b 100644 --- a/tips/reopen-with-encoding.mdx +++ b/tips/reopen-with-encoding.mdx @@ -7,7 +7,11 @@ tags: - encoding - files - internationalization -prUrl: https://github.com/zed-industries/zed/pull/46553 +prUrl: 'https://github.com/zed-industries/zed/pull/46553' +publishedAt: '2026-02-05' +updatedAt: '2026-02-05' +author: godruoyi +authorUrl: 'https://github.com/godruoyi' --- Fix **garbled text** caused by incorrect encoding detection by using the "Reopen with Encoding" feature. Select from Shift JIS, EUC-JP, UTF-16LE, and other encodings to properly display your files. diff --git a/tips/syntax-node-selection.mdx b/tips/syntax-node-selection.mdx index c4560fa..b6db0dd 100644 --- a/tips/syntax-node-selection.mdx +++ b/tips/syntax-node-selection.mdx @@ -7,7 +7,11 @@ tags: - selection - editing - navigation -prUrl: https://github.com/zed-industries/zed/pull/47571 +prUrl: 'https://github.com/zed-industries/zed/pull/47571' +publishedAt: '2026-02-05' +updatedAt: '2026-02-05' +author: godruoyi +authorUrl: 'https://github.com/godruoyi' --- Use **syntax node selection commands** to extend your selection to the start or end of larger syntax nodes, making it easy to select complete code structures precisely. diff --git a/tips/terminal-tab-rename.mdx b/tips/terminal-tab-rename.mdx index 35ab2d4..40d9756 100644 --- a/tips/terminal-tab-rename.mdx +++ b/tips/terminal-tab-rename.mdx @@ -7,9 +7,13 @@ tags: - terminal - organization - workflow -prUrl: https://github.com/zed-industries/zed/pull/45800 +prUrl: 'https://github.com/zed-industries/zed/pull/45800' mediaType: video -mediaUrl: https://github.com/user-attachments/assets/be81a95b-1f64-4ebd-94e4-7cfe6a1e9ddb +mediaUrl: 'https://cat.zed.tips/2026-02-05/terminal-tab-rename-ef31410b.mp4' +publishedAt: '2026-02-05' +updatedAt: '2026-02-05' +author: godruoyi +authorUrl: 'https://github.com/godruoyi' --- Keep your terminal sessions organized by **renaming terminal tabs**. Give each terminal a meaningful name to quickly identify different tasks like "server", "tests", or "git". diff --git a/tips/vim-gdefault-setting.mdx b/tips/vim-gdefault-setting.mdx index 963c6b1..b699bea 100644 --- a/tips/vim-gdefault-setting.mdx +++ b/tips/vim-gdefault-setting.mdx @@ -7,7 +7,11 @@ tags: - vim - substitution - settings -prUrl: https://github.com/zed-industries/zed/pull/47664 +prUrl: 'https://github.com/zed-industries/zed/pull/47664' +publishedAt: '2026-02-05' +updatedAt: '2026-02-05' +author: godruoyi +authorUrl: 'https://github.com/godruoyi' --- Enable **vim.gdefault** to make `/g` (replace all matches in a line) the default behavior for Vim substitute commands, eliminating the need to type `/g` every time. diff --git a/tips/vim-relative-line-jump.mdx b/tips/vim-relative-line-jump.mdx index da012b4..9b87091 100644 --- a/tips/vim-relative-line-jump.mdx +++ b/tips/vim-relative-line-jump.mdx @@ -7,9 +7,13 @@ tags: - vim - navigation - shortcuts -prUrl: https://github.com/zed-industries/zed/pull/46932 +prUrl: 'https://github.com/zed-industries/zed/pull/46932' mediaType: video -mediaUrl: https://github.com/user-attachments/assets/395c0e7b-8ac1-48c8-a39e-5ade4f9206ec +mediaUrl: 'https://cat.zed.tips/2026-02-05/vim-relative-line-jump-e57f2c24.webm' +publishedAt: '2026-02-05' +updatedAt: '2026-02-05' +author: godruoyi +authorUrl: 'https://github.com/godruoyi' --- The go-to-line action now supports **relative line jumping**, allowing you to jump to lines relative to your current cursor position using Vim/Neovim syntax.