Ubuntu 20.04 安装并使用Cursor

发布于:2025-03-23 ⋅ 阅读:(24) ⋅ 点赞:(0)

1. 安装

1.1 下载

cursor 官网 : https://www.cursor.com/cn
在这里插入图片描述
点击 下载LINUX
查看下载下来的文件:

$ ls ~/Downloads/Cursor-0.47.8-82ef0f61c01d079d1b7e5ab04d88499d5af500e3.deb.glibc2.25-x86_64.AppImage 
/home/xxx/Downloads/Cursor-0.47.8-82ef0f61c01d079d1b7e5ab04d88499d5af500e3.deb.glibc2.25-x86_64.AppImage

1.2 检查文件

$ cd ~/Downloads/
$ shasum Cursor-0.47.8-82ef0f61c01d079d1b7e5ab04d88499d5af500e3.deb.glibc2.25-x86_64.AppImage 
eef7c20923c9bebfd15d085ae0d320082dfe344d  Cursor-0.47.8-82ef0f61c01d079d1b7e5ab04d88499d5af500e3.deb.glibc2.25-x86_64.AppImage

输出文件的 SHA256 哈希值。可以将这个值与官方提供的哈希值进行对比,确保文件完整无误。

1.3 安装

赋予执行权限

$ chmod +x Cursor-0.47.8-82ef0f61c01d079d1b7e5ab04d88499d5af500e3.deb.glibc2.25-x86_64.AppImage
$ ll Cursor-0.47.8-82ef0f61c01d079d1b7e5ab04d88499d5af500e3.deb.glibc2.25-x86_64.AppImage 
-rwxrwxr-x 1 xjg xjg 187294912 320 17:50 Cursor-0.47.8-82ef0f61c01d079d1b7e5ab04d88499d5af500e3.deb.glibc2.25-x86_64.AppImage*

1.4 创建桌面启动器

$ sudo mv Cursor-0.47.8-82ef0f61c01d079d1b7e5ab04d88499d5af500e3.deb.glibc2.25-x86_64.AppImage /opt/cursor.appimage
sudo gedit /usr/share/applications/cursor.desktop

在/usr/share/applications/cursor.desktop 写入下面内容:

[Desktop Entry]
Type=Application
Name=Cursor
Exec=/opt/cursor.appimage
Icon=/opt/cursor.png
Categories=Development;

下载下面图片:
在这里插入图片描述

$ cd ~/Downloads
$ mv 8fd8a6d491384f65a56adc6f2b666d62.png /opt/cursor.png
$ ll /opt/cursor.png 
-rw-rw-r-- 1 xjg xjg 7149 320 21:39 /opt/cursor.png

查看 cursor.png

$ cd /opt
$ nautilus .

在这里插入图片描述

2. 运行

2.1 启动

在这里插入图片描述
也可以

$ /opt/cursor.appimage

这时:
在这里插入图片描述

2.2 快捷键

  • Ctrl + L 打开对话框
    也可以选中代码块 Ctrl + L ,根据代码块对话
  • Ctrl + K 打开生成窗口
  • Ctrl + I 打开Composer , 用于多文件修改

2.2.1 @注记

@Files : 传递指定代码文件的上下文
@Code : 传递指定代码块(函数和类)的上下文
@Docs : 从官方文档获取上下文(需要在配置文件添加上下文)
@Web : 从搜索结果获取上下文
@Folders : 传递文件目录信息上下文
@Chat : 传递对话窗口内容上下文(仅限代码生成窗口)
@Definitions : 传递变量和类型定义上下文(仅限代码生成窗口)
@Git : 传递Git仓库commit历史(仅限对话窗)
@Codebase : 在代码文件仓库扫描文件输入(仅限对话窗)