diff --git a/tips/agent-context-menu.mdx b/tips/agent-context-menu.mdx new file mode 100644 index 0000000..f42edc5 --- /dev/null +++ b/tips/agent-context-menu.mdx @@ -0,0 +1,46 @@ +--- +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://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. + +## 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..4aba636 --- /dev/null +++ b/tips/hot-exit-empty-workspaces.mdx @@ -0,0 +1,48 @@ +--- +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' +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. + +## 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..28497d5 --- /dev/null +++ b/tips/image-viewer-zoom-pan.mdx @@ -0,0 +1,49 @@ +--- +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://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. + +## 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..20f0f9b --- /dev/null +++ b/tips/reopen-with-encoding.mdx @@ -0,0 +1,57 @@ +--- +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' +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. + +## 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..b6db0dd --- /dev/null +++ b/tips/syntax-node-selection.mdx @@ -0,0 +1,57 @@ +--- +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' +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. + +## 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..40d9756 --- /dev/null +++ b/tips/terminal-tab-rename.mdx @@ -0,0 +1,46 @@ +--- +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://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". + +## 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..b699bea --- /dev/null +++ b/tips/vim-gdefault-setting.mdx @@ -0,0 +1,66 @@ +--- +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' +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. + +## 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..9b87091 --- /dev/null +++ b/tips/vim-relative-line-jump.mdx @@ -0,0 +1,59 @@ +--- +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://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. + +## 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.