Successfully Utilizing Cursor for 10x Coding
A lot of our work has modified tremendously within the period of generative AI. This contains coding work, the place the big language mannequin (LLM) tremendously boosts the method.
Just lately, many code-assisting instruments powered by generative AI have been launched. Many do the identical issues, however one software that catches the general public’s eye is Cursor. Cursor is an AI-powered Code Editor designed for builders to concentrate on enhancing their working expertise slightly than solely fixing their code.
The cursor is useful to builders, together with information scientists. This text will discover easy methods to use the IDE successfully for 10x coding.
How does it work? Let’s get into it.
Successfully Utilizing Cursor
Cursor is an IDE that was initially a fork of VS Code, so will probably be straightforward so that you can bounce into Cursor in case you are already acquainted with the latter.
As I discussed above, Cursor is an IDE powered by Generative AI that helps us code. However how precisely does the Cursor assist? There are various options out there, however typically, Cursor helps you in 3 ways:
- Code Autocomplete
- Chatting together with your Codebase
- Edit and Write your Code
These are the final options you’ll be able to anticipate from Cursor, however we are going to discover in additional element easy methods to use Cursor successfully.
As a reminder, the code high quality will depend upon the LLM mannequin you utilize. As of the time this text was written, Cursor solely permits the GPT household, Claude household, and Cursor Small mannequin. It’s additionally potential to make use of the Google mannequin, however it’s worthwhile to assign your API key.
Talking of assigning your API key, all of the household fashions above may be accessed by way of your API key if you wish to use bills coming out of your account. If not, you’ll be able to entry the premium mannequin with a Cursor subscription. The Cursor Small mannequin is at all times free, however the high quality may be higher than that of the opposite mannequin.
Let’s begin utilizing Cursor for our work. Earlier than we start, guarantee that you’ve got put in Cursor in your surroundings.
Code Era and Enhancing
We are going to check out the code technology characteristic. To do this, press the Ctrl + Okay button, and the textual content bar will seem.
For the instance. We generate the script to learn the CSV information and practice the mannequin. You possibly can observe the immediate beneath.
As you’ll be able to see within the above picture, the generated code is on the market immediately. You possibly can select to simply accept the code, reject it, or put a follow-up instruction in it.
One other instance of code technology is utilizing present code and dealing based mostly on that. Within the picture beneath, we are going to ask Cursor for additional choices for mannequin analysis, and Cursor will present them.
When you have already got the code generated or have the script in your surroundings, Cursor can recommend acceptable code for our work. Should you settle for them, you solely must press the tab button, and the code shall be generated.
Even in case you write the code carelessly, Cursor can assist you repair it and gauge your intention.
With all of the options above, you’ll enhance your work effectivity in creating your information science mission.
Chat with Your Codebase
The opposite characteristic that Cursor is nice at is to permit you to chat together with your code. By chatting, you’ll be able to particularly chat in your entire code script or a specific a part of the code. Both method, press the Ctrl + L button to talk together with your code.
For instance, we chatted with our beforehand generated code as a reference, and we requested to enhance the code.
Because the picture above reveals, the Cursor explains your directions and code strategies. It is not going to robotically apply the code to your code, as we have to press the Apply button to use the suggestion.
Then, it is best to settle for the modifications for every reworked code as nicely. The transformation is not going to take away your authentic code till you agree with the modifications.
Subsequent, the chat characteristic means that you can point out further recordsdata out of your surroundings and even the web. The cursor referred to as it a “point out” characteristic.
For instance, we are going to ask Cursor to scour the online to enhance our code, as within the picture beneath.
Identical to the earlier instance, the code end result must be utilized manually.
Lastly, it is potential to connect photos within the chat options. By doing that, we are able to chat with our codes whereas additionally having picture references.
For instance, I wish to produce a selected plot just like the picture I’ve from the present code I’ve. On this case, I might connect an instance of my picture and ask the Cursor to offer directions on easy methods to generate the plot.
The talked about characteristic is mighty as you’ll be able to connect many issues whilst you can preserve following up with no matter you want.
That is all it’s worthwhile to know to make use of Cursor successfully.
Conclusion
Cursor is a programming IDE that’s designed to help builders in coding works with Generative AI. Primarily there are three most important options you should use to make use of Cursor successfully:
- Code Autocomplete
- Chatting together with your Codebase
- Edit and Write your Code
By using all of the options above, you’ll be able to enhance your coding work by 10x. The IDE improvement continues to be in progress as nicely, so preserve being attentive to the Cursor options that may assist your work.
I hope this has helped!
Cornellius Yudha Wijaya is an information science assistant supervisor and information author. Whereas working full-time at Allianz Indonesia, he likes to share Python and information ideas by way of social media and writing media. Cornellius writes on a wide range of AI and machine studying matters.