Cursor - an automatic coding tool! Installation and usage tutorial

Introduction to Cursor

The official gitHub website
Cursor is a programmer assistance tool developed by OpenAI.

Main functions and features

  1. It retains the coding style of Idea, has a simple interface and supports a variety of plug-ins.
  2. Support Max, Linux, Windows systems
  3. Enter the requirements in the workspace, either in Chinese or English, and the corresponding requirement implementation code can be quickly generated.
  4. Select the code to analyze the code, interpret the code, and help understand the meaning of the code.
  5. Through CHAT with AI, code can be optimized and code quality improved.
  6. Currently only supports 100 uses a month

Item usage tutorial

Click to download, punch in the installation package, and install it to the appropriate path on your local computer.
Insert image description here
When you open Cursor, you can see a concise page. The leftmost vertical column identifies the file directory, the middle is the code writing area, and the rightmost vertical column is the area where the user chats with the AI ​​model.
Insert image description here
In the leftmost column, find "+" to create a new file. The suffix name can be added according to personal circumstances, such as "demo.java". Of course, you can also not add the suffix name. Just adding the suffix name can trigger the code style of Idea, which will look more intuitive.
Insert image description here
Enter Ctrl+k, and a box will appear. Enter the requirements described in natural language, that is, human language, in the box. After inputting, enter Enter to automatically generate the implementation code of the requirements.
Enter requirements
The automatically and quickly generated code is as shown in the figure.
generated code
If the code segment is not clear, you can select the code block and enter Ctrl+L. AI can analyze the code block and give a code interpretation in natural language ( PS, since AI defaults to The output is in English, so when we ask, we can add "Please answer in Chinese" at the end) .
Insert image description here
Of course, if you encounter a code segment that has problems interpreting in daily life, you can also use the magic keys (Ctrl + C and Ctrl + V) to paste the code into the Cursor code area, select the code block and enter Ctrl + k to let the AI ​​interpret it. Select the code segment (it works well in actual testing!!)
Insert image description here

scenes to be used

  1. Personal learning to help decipher complex code.
  2. Algorithm learning, AI models can quickly write algorithms that meet needs, and are also suitable for personal algorithm learning (a homework help for programmers!)
  3. Code optimization, using AI models, constantly chatting with AI to find better algorithm structures

Summarize

Although AI tools are improving day by day, for programmers, AI is always just a tool. The meaning of their existence is to help programmers better improve themselves and save personal time, but I still hope that everyone will not rely too much on AI tools. After all, Encountering difficulties and solving them is the process of honing one's thinking.

Guess you like

Origin blog.csdn.net/cleverstronge/article/details/130318363