Cursor介绍

AI 时代程序员必备技能

Codex、Claude Code、Cursor、Hermes Agent、OpenClaw等工程化实战专栏 ,讲透 AI 如何接管脏活累活

Cursor code/cursor 命令

Cursor 是一款基于 Visual Studio Code (VS Code) 的现代化代码编辑器,所以它继承了 VS Code 的强大功能,如本文要介绍的 code 命令。

在 Visual Studio Code 中,code 或 cursor 命令是一个命令行工具,用于快速打开 VS Code 并执行一些与代码相关的作。

code 命令直接可以帮助开发者从终端或命令提示符中直接启动 VS Code 或处理特定的任务。

最常用的方式就是使用 code 或 cursor命令直接从命令行中打开文件目录,此时需要先安装 code 命令。

Cursor 支持将终端启动命令设置为 code 或 cursor,以便快速启动编辑器,如果本地已经安装了 VS Code,code 命令一般用在 VS Code 中,Cursor 使用 cursor 命令。

启用 Cursor 的 code 命令 非常简单,先打开命令面板:

  • macOS 系统快捷键:⇧⌘P(command + shift + p)
  • Windows/Linux 快捷键: Ctrl + Shift + P

搜索安装 >shell 命令:

然后选择 在 PATH 中 安装 “cursor” 命令 - Shell Command: Install 'cursor' command in PATH 即可为系统 PATH 路径添加了 cursor 命令的引用。

我们可以通过命令行打开文件、安装扩展、修改显示语言,甚至查看诊断信息。

通过 cursor --version 查看版本信息:

# cursor --version
0.45.14
906121b8c0bdf041c14a15dac228e66ab5505260
arm64

以下是一些常用的命令行选项,可以通过 cursor --help 命令查看:

Cursor 0.45.14

Usage: cursor [options][paths...]

To read from stdin, append '-' (e.g. 'ps aux | grep code | cursor -')

Options
  -d --diff <file> <file>                    Compare two files with each
                                             other.
  -m --merge <path1> <path2> <base> <result> Perform a three-way merge by
                                             providing paths for two modified
                                             versions of a file, the common
                                             origin of both modified versions
                                             and the output file to save merge
                                             results.
  -a --add <folder>                          Add folder(s) to the last active
                                             window.
  -g --goto <file:line[:character]>          Open a file at the path on the
                                             specified line and character
                                             position.
  -n --new-window                            Force to open

AI 时代程序员必备技能

Codex、Claude Code、Cursor、Hermes Agent、OpenClaw等工程化实战专栏 ,讲透 AI 如何接管脏活累活

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

奋进学堂

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值