大家好,我是汤师爷
最近几个月,Cursor迅速走红,成为一款强大的编程助手。Cursor不仅使用简单,而且通过集成各种大模型技术,编程能力一流。
Cursor是什么?
Cursor是一个类似VSCode的编辑器,集成了GPT-4、Claude 3.5等LLM模型。它本质上是在VSCode的基础上添加了AI辅助编程功能。
从界面布局到操作方式都与VSCode保持一致,包括扩展下载、Python环境配置、远程服务器连接和设置等功能。
如果你是VSCode的老用户,可以无缝切换到Cursor。
Cursor的下载
首先我们打开官网 cursor.com ,点击右上角的【download】按钮,下载 Cursor 的客户端。

配置中文插件
点击右上角的小图标,展开左侧界面,点击第四个插件图标,切换到插件栏。
搜索框中输入【中文】,找到中文简体插件,点击【Install】按钮。现在界面就是中文了!

用 Cursor 写出第一个程序
我们以制作一个俄罗斯方块游戏为例,手把手教你写一个完整的程序。
首先我们打开一个文件夹,点击【文件】,点击【打开】。

新建一个【cursor_tutorial】文件夹,用这个文件夹来存放代码文件。

我们点击右上角的按钮,打开侧边栏。调出对话框,并在对话框里发送:
```markdown
用 Java 帮我写一个俄罗斯方块游戏。
```

过了大约十秒,就生成好代码了,点击【Run command】,cursor会自动启用终端执行命令:
```markdown
javac Tetris.java Board.java Shape.java && java Tetris
```
俄罗斯方块游戏已经大功告成。

我们还可以继续为游戏加功能,在对话框里继续发送:
```markdown
添加下一个方块预览
```

点击【Run command】。

下一个方块预览的功能已经实现好啦。

再添加一个分数系统的功能。

Cursor很快又完成了。

总结
看完这个小demo,我们可以看到Cursor很好上手,跟VSCode一样的操作方式,老VSCode用户直接无缝切换。
Java选手之前用的IDEA,可能一开始不习惯,但很快也能上手开发。
Cursor各种编程语言都能整,各种框架也都不在话下,真心建议试试Cursor,绝对是下一代编程工具。
本文已收录于,我的技术网站:tangshiye.cn 里面有,AI 编程、算法 Leetcode 详解、面试八股文、BAT面试真题、简历模版、架构设计,等经验分享。