3

性能的极致,Rust的加持,Zed.dev编辑器快速搭建Python3.10开发环境

 1 year ago
source link: https://v3u.cn/a_id_290
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
性能的极致,Rust的加持,Zed.dev编辑器快速搭建Python3.10开发环境

    快就一个字,甚至比以快著称于世的Sublime 4编辑器都快,这就是Zed.dev编辑器。其底层由 Rust 编写,比基于Electron技术微软开源的编辑器VSCode快一倍有余,性能上无出其右,同时支持多人编辑代码。

    安装和配置Zed.dev

    Zed.dev编辑器还在灰度测试阶段,暂时只释出了Mac版本,在Zed.dev官网下载,安装成功后,进入Zed.dev编辑器,使用组合键 Command + ,   调出编辑器的配置文件:

// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
"theme": "One Dark",
}

    编辑器默认使用暗黑风格的One Dark主题,也可以通过配置theme来选择别的主题,比如"Rosé Pine Moon:

"theme": "Rosé Pine Moon",

    如图所示:

20230314110344_58313.png

    除此之外,我们也可以配置其他的设置,以方便日常的开发:

// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
"theme": "Rosé Pine Moon",
"soft_wrap": "editor_width",
"autosave": "on_focus_change",
"tab_size": 4,
"buffer_font_size": 15,
"language_overrides": {
"Python": {
"format_on_save": {
"external": {
"command": "black",
"arguments": ["-"]
}
}
}
}
}

    这里配置了自动保存,缩进空格,自适应断行等等。

    Zed.dev默认支持的语言列表:

C
C++
CSS
HTML
Elixir
Go
JavaScript
JSON
Markdown
Python
Ruby
Rust
TOML
TSX
TypeScript

    也就是说默认支持上述语言的自动补全,而不需要单独配置:

20230314110359_88567.png

    虽然Zed.dev还不支持插件,但内部集成了系统的终端,直接通过组合键 esc + shift 打开终端即可运行代码:

20230314110303_52990.png

    非常方便,也可以通过组合键 Command + b  来自由收放左侧文件列表菜单栏。

    大体上,基本不需要配置什么,就可以直接用Zed.dev来写代码了,即所谓开箱可用。

    项目共享协作

    我们可以从协作菜单中添加一个现有的Zed.dev用户作为联系人,从窗口右上角的加号图标进行部署,或者通过组合键command-shift-c,然后单击搜索框右侧的添加图标按钮:

20230314110350_69076.png

    随后可以在协作菜单中看到所有在线或者离线联系人。搜索或点击他们将发送一个请求,开始呼叫并与他们共享当前的项目,他们将收到加入呼叫的通知。

    这之后所有连入Zed.dev项目的人就可以进行代码联调了,效率上要比Git高出了不少。

    快速轻便,简单清爽,这就是Zed.dev给我们的第一印象,很明显,在桌面编辑器层面,Rust具有及其出挑的优势,它以闪电般的速度处理功能复杂的任务,同时还减少了与内存、边界、空变量、初始化变量或整数溢出相关的错误,下面是Zed.dev的内存占用情况:

20230314110301_35270.png

    最后附上邀请码,与君共觞:zed.dev/invites/T7MtltpVii8thwIW


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK