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

然后打印就有了

相关推荐
需要8266 小时前
Arthas 一个命令排查线上问题
java·jvm·spring·spring cloud
Kyrie_kk6 小时前
Java--ProcessBuilder操作系统进程
java·后端
SamDeepThinking6 小时前
关于java final关键字的可见性
java·后端·面试
Wang's Blog7 小时前
Java 项目实战: 外卖平台-MyBatis-Plus分页插件与员工分页查询
java·项目开发
MetaLite7 小时前
全网最好的SpringBoot接口请求对象设计
java·spring boot·后端
蜗牛互联网7 小时前
AI给面试打分不够,求职者更需要可核对的证据
java·人工智能·后端
此时不提桶,更待何时7 小时前
02-05-B-虚拟线程面试与生产事故实战
java·面试
名字还没想好☜7 小时前
Spring Boot 3.2 RestClient 实战:替代 RestTemplate 调外部接口,超时、连接池与错误处理
java·后端·spring
摇滚侠8 小时前
《Spring Boot 3:高级与架构设计》第 2 章 IOC容器的高级机制 BeanFactoryPostProcessor 个人理解 6
java·spring boot·笔记·后端
程序员阿鹏8 小时前
简单介绍一下软引用
java·开发语言·jvm·数据结构·后端