Cursor 迁移到 Zed 编辑器

文章目录

  • 目的
  • [Zed 编辑器简介](#Zed 编辑器简介)
  • 常见问题
    • [首次进入 Zed 的全局配置](#首次进入 Zed 的全局配置)
    • [保存文件时 eslint 修复](#保存文件时 eslint 修复)
    • 面板靠右侧
    • [最终的 setting.json](#最终的 setting.json)
    • [终端添加 zed](#终端添加 zed)
    • 添加代码片段

目的

我的小电脑撑不住了,太卡了,所以找一个轻量的 ide


Zed 编辑器简介

这个是官网 https://zed.dev/


常见问题

首次进入 Zed 的全局配置

javascript 复制代码
{
  "terminal": {
    "cursor_shape": "bar",
    "blinking": "on",
    "option_as_meta": true
  },
  "tabs": {
    "close_position": "left"
  },
  "sticky_scroll": {
    "enabled": true
  },
  "use_system_window_tabs": true,
  "max_tabs": 5,
  "use_system_path_prompts": true,
  "buffer_font_family": "Input",
  "show_whitespaces": "boundary",
  "show_edit_predictions": true,
  "ensure_final_newline_on_save": true,
  "base_keymap": "Cursor",
  "theme": {
    "mode": "system",
    "light": "One Light",
    "dark": "One Dark"
  },
  "format_on_save": "off"
}

保存文件时 eslint 修复

在你的项目下新建 .zed 文件夹,然后创建 settings.json 文件

javascript 复制代码
{
  "format_on_save": "on",
  "formatter": [
    { "code_action": "source.fixAll.eslint" },
    { "code_action": "source.organizeImports" }
  ],
}

类似这个样式, 具体配置可以看官网 https://zed.dev/docs/configuring-zed#formatter

效果演示

面板靠右侧

最终的 setting.json

json 复制代码
// ~/.config/zed/settings.json
{
  "project_panel": {
    "dock": "right"
  },
  "icon_theme": "Zed (Default)",
  "terminal": {
    "cursor_shape": "bar",
    "blinking": "on",
    "option_as_meta": true
  },
  "tabs": {
    "close_position": "left"
  },
  "sticky_scroll": {
    "enabled": true
  },
  "use_system_window_tabs": true,
  "max_tabs": 5,
  "use_system_path_prompts": true,
  "buffer_font_family": "Input",
  "show_whitespaces": "boundary",
  "show_edit_predictions": true,
  "ensure_final_newline_on_save": true,
  "base_keymap": "Cursor",
  "theme": {
    "mode": "system",
    "light": "Vitesse Refined Light",
    "dark": "Vitesse Refined Dark Soft"
  },
  "format_on_save": "off"
}

终端添加 zed

添加代码片段

然后选择语言

我这里是 react ,所以选择 tsx

然后打印就有了

相关推荐
摇滚侠7 小时前
在 SpringBoot 项目中,开发工具使用 IDEA,.idea 目录下的文件需要提交吗
java·spring boot·intellij-idea
云姜.7 小时前
java多态
java·开发语言·c++
李堇7 小时前
android滚动列表VerticalRollingTextView
android·java
泉-java8 小时前
第56条:为所有导出的API元素编写文档注释 《Effective Java》
java·开发语言
zfoo-framework8 小时前
帧同步和状态同步
java
charlotte102410248 小时前
高并发:关于在等待学校教务系统选课时的碎碎念
java·运维·网络
亓才孓8 小时前
[JDBC]PreparedStatement替代Statement
java·数据库
_F_y9 小时前
C++重点知识总结
java·jvm·c++
打工的小王9 小时前
Spring Boot(三)Spring Boot整合SpringMVC
java·spring boot·后端
毕设源码-赖学姐9 小时前
【开题答辩全过程】以 高校体育场馆管理系统为例,包含答辩的问题和答案
java·spring boot