Zed is a Mac text editor for web developers with a clean interface, autocompletion for coding, syntax highlighting, multitasking, built-in terminal, Git integration, and customization options. It’s lightweight, fast, and ideal for enhancing productivity.
Breadcrumbs
A breadcrumb trail is displayed at the top of multi-buffers and singleton buffers with the path of the file containing the cursor along with a summary of the containing syntax nodes. This can be especially helpful in multi-buffers or within large functions.
CLI
To install the zed
command line tool, select Zed > Install CLI
from the application menu. Then you can type zed my-path
on the command line to open a directory or file in Zed. To use Zed as your $EDITOR
to edit Git commits etc, add export EDITOR="zed --wait"
to your shell profile.zed
命令行工具,从应用程序菜单中选择 Zed > Install CLI
。然后,您可以在命令行上键入 zed my-path
以在 Zed 中打开目录或文件。要使用 Zed 作为编辑 Git 提交等$EDITOR
,请在 shell 配置文件中添加 export EDITOR="zed --wait"
Code Actions
Whenever you see a lightning bolt next to the gutter, it means a code action is available for the current cursor location from the language server. You can click the lightning bolt or press cmd-. to reveal available actions.
Code actions affecting multiple files will present the results of the action in a multi-buffer. To undo the action, simply hit cmd-z in the multi-buffer, although we don’t yet support undoing file-system changes. To save the results of a multi-file code action, just save the multi-buffer.
Command Palette
If there’s one default key binding to remember, it’s cmd-shift-p. This deploys the command palette, which is a gateway to much of the other functionality that Zed offers and a convenient tool for learning key bindings.
Available commands depend of what is focused. For example, if you focus the project panel, you’ll see project panel: add file in the command palette, but you won’t see that command if an editor is focused.
Language Servers
When you open first open a file in a specific language, Zed will download and start the appropriate language server if it’s supported. Rust remains our primary focus in the short term, but Zed currently has hard-coded language server support for:
The ability to connect Zed with an arbitrary language server is under active development.
Multi-buffers
Multi-buffers are edited much like ordinary buffers, but they contain editable excerpts from multiple different files. They’re used in multiple ways in Zed. In the case of project search, you’ll see an excerpt with a few context lines surrounding every match.
Multi-buffers allow you to perform multi-cursor edits that span multiple files. When you save a multi-buffer, every excerpted file is saved.
To jump to the cursor’s location in a dedicated buffer for the excerpted file, press alt-enter
. If you have multiple cursors, a tab will be opened for the location of each cursor.alt-enter
。如果您有多个游标,则将为每个游标的位置打开一个选项卡。
Zed 0.149.3:
macOS 10.12 or later