{"id":1388,"date":"2025-05-12T13:00:11","date_gmt":"2025-05-12T13:00:11","guid":{"rendered":"http:\/\/www.diveintoaccessibility.com\/?p=1388"},"modified":"2025-05-19T16:30:26","modified_gmt":"2025-05-19T16:30:26","slug":"6-cursor-ai-tips-you-should-know","status":"publish","type":"post","link":"http:\/\/www.diveintoaccessibility.com\/index.php\/2025\/05\/12\/6-cursor-ai-tips-you-should-know\/","title":{"rendered":"6 Cursor AI Tips You Should Know"},"content":{"rendered":"

Cursor is a code editor designed to help you write code faster and more efficiently. It uses AI assistants that understand your code, offers smart suggestions, generates code snippets, and even helps fix bugs.<\/p>\n

To make the most of Cursor, it\u2019s important to use it effectively. In this article, we\u2019ll share practical tips and tricks to boost your workflow and get the best results in this AI-powered code editor<\/a>.<\/p>\n

Ready to boost your productivity? Here are some practical ways to get the most out of Cursor.<\/p>\n


\n

1. Use the Cursor CLI<\/h2>\n

The cursor CLI is a command-line tool for Windows, macOS, and Linux that allows you to interact with the Cursor editor directly from your terminal. To install the CLI, you can launch the command palette with Cmd\/Ctrl<\/kbd>+P<\/kbd>, and select the Shell Command: Install \u201ccursor\u201d command<\/strong> menu, as follows:<\/p>\n

\"Installing <\/figure>\n

It works similarly to the code<\/code> CLI for VSCode. It allows you, for example, to create, manage, and open projects in the Cursor editor without leaving the command line.<\/p>\n

In addition to project management, the CLI also helps you handle extensions in Cursor. You can list installed extensions, update them, or uninstall ones you no longer need with simple commands.<\/p>\n

Here are a few examples of how you can use the cursor<\/code> CLI:<\/p>\n

Open current directory in Cursor editor:<\/h5>\n
\r\ncursor .\r\n<\/pre>\n
Add folder to the last active window:<\/h5>\n
\r\ncursor --add site\r\n<\/pre>\n
List currently installed extensions:<\/h5>\n
\r\ncursor --list-extensions\r\n<\/pre>\n

Using the CLI is particularly useful especially if you frequently or prefer working in the Terminal, as it could help making your development process more efficient.<\/p>\n


\n

2. Use Context<\/h2>\n

The chat feature in Cursor allows you to interact with the AI assistant<\/a> directly. You can ask questions, request code changes, and get suggestions that you can apply with a single click.<\/p>\n

One important thing to remember is that Cursor works best when you provide the right context. The more relevant details you include, the better its responses will be.<\/p>\n

A great way to do this is by tagging relevant files using @<\/strong>. This helps the AI understand your code better and give more precise suggestions.<\/p>\n

For example, if you want to create a test for a class, you can tag the file.<\/p>\n

\"Using <\/figure>\n

This way it can understand better what the code is about and thus can also provide more accurate responses. If you\u2019re happy with it, you can simply click on the Apply<\/strong> option. It also understands where to put it in the directory, as we can see below:<\/p>\n

\"Applying <\/figure>\n
\n

3. Use Image for Context in Chat<\/h2>\n

Furthermore, one of the cool things about Cursor chat is that you\u2019re able to include image as context. You can do so by drag-n-drop the image on the chat box.<\/p>\n

When an image is included, it can analyze it alongside the provided text, enabling it to generate more relevant and accurate code. This is particularly useful for tasks that require visual cues, such as updating user interfaces or replicating design elements from mockups.<\/p>\n

In this example, we will use it to generate an SVG.<\/p>\n

\"Using <\/figure>\n

It\u2019s pretty handy!<\/p>\n

But it\u2019s important to note that results may vary depending on the image\u2019s complexity and the task. It can still struggle with finer details.<\/p>\n


\n

4. Use Custom Rules<\/h2>\n

Cursor also ships with a feature called Rules for AI<\/strong>.<\/p>\n

This feature allows you to define rules for the AI to follow when suggesting or generating codes. You can define the format, naming conventions, best practices for your project, or apply rules for specific files.<\/p>\n

This is super helpful if you\u2019re working with a team and need everyone to follow the same coding rules, or if you just have a personal way of doing things. It can save you time, avoid unnecessary edits, and get suggestions that fit your workflow perfectly.<\/p>\n

So, to set up the rules, you can go to the Settings > Cursor Settings > Rules<\/strong>. Click on the + Add new rule<\/strong>. Then, you will need to add the name, description, and optionally attach a file to the rule.<\/p>\n

\"Creating <\/figure>\n

Now, it\u2019s time to set up your rules.<\/p>\n

If you\u2019re just getting started, keep it simple. Don\u2019t try to define every rule at once. Focus on the most important ones first. Then, test how the AI responds and refine your rules as needed to get the best results.<\/p>\n

Here is an example of how we can describe the rule:<\/p>\n

\"Setting <\/figure>\n

This will ensure the AI assistant would follow PSR-12 convention when generating PHP codes with few exceptions, and also apply specific rule to a one specific file.<\/p>\n


\n

5. Use Notepads<\/h2>\n

Another feature in Cursor that can make your workflow even more efficient is Notepads<\/strong>. By default, this feature might be hidden in the editor, but you can enable it by right-clicking on the Primary Sidebar<\/strong> on the right side and selecting Notepads<\/strong> from the menu.<\/p>\n

\"Enabling <\/figure>\n

Now, you can find Notepads<\/strong> in the Cursor sidebar. Create a new one with a clear name, add your content using plain text or markdown.<\/p>\n

You can add for example the write down the project architecture decisions, recording development guidelines and best practices, and helping maintain consistency across your codebase.<\/p>\n

If you frequently use certain code snippets, Notepads can act as a handy place to store reusable templates. It\u2019s also great for keeping frequently referenced documentation, like API details, troubleshooting steps, or internal workflows.<\/p>\n

Here is an example where we define the architecture decisions for the Frontend projects:<\/p>\n

\"Frontend <\/figure>\n

Now, you can refer your Notepads<\/strong> in Chat or in Composer (Agent) in Cursor, using @Notepads<\/code>.<\/p>\n

\"Referencing <\/figure>\n
\n

6. Documentation Integration<\/h2>\n

Cursor, like any AI assistant or tool, works best when it has the right context, such as relevant documentation, to guide its responses.<\/p>\n

In Cursor, you can add and reference external documentation directly in the editor to give the AI assistant access to important resources.<\/p>\n

By default, Cursor already includes a wide range of official documentation, covering frameworks like WordPress, Laravel, Vue, React, Angular, and many more. If the documentation you need isn\u2019t available, you can easily add it by providing a URL. This is especially useful for including internal team documentation. As long as the content is publicly accessible, Cursor can fetch and use it.<\/p>\n

To includes documentation as reference, you can type @docs<\/code> in the chat box, and then you can search for the documentation you need.<\/p>\n

\"Searching <\/figure>\n

In this example, I add the reference to the WordPress official docs<\/a> and ask Cursor to create a post type.<\/p>\n

\"Creating <\/figure>\n

Cursor is quite smart that it defined the post type with a class with proper name, add it in proper directory, set the private<\/code> option to false<\/code> and add all translatable labels with the correct text domain.<\/p>\n


\n

Wrapping Up<\/h2>\n

Cursor is a powerful AI assistant that can help you write code faster, and improve your workflow. In this article, we\u2019ve explored some of the tips and tricks that can help you get the most out of Cursor. Hopefully, you\u2019ve found them useful and can apply them to your own projects.<\/p>\n

The post 6 Cursor AI Tips You Should Know<\/a> appeared first on Hongkiat<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"

Cursor is a code editor designed to help you write code faster and more efficiently. It uses AI assistants that understand your code, offers smart […]<\/p>\n","protected":false},"author":1,"featured_media":1390,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"_links":{"self":[{"href":"http:\/\/www.diveintoaccessibility.com\/index.php\/wp-json\/wp\/v2\/posts\/1388"}],"collection":[{"href":"http:\/\/www.diveintoaccessibility.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.diveintoaccessibility.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.diveintoaccessibility.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.diveintoaccessibility.com\/index.php\/wp-json\/wp\/v2\/comments?post=1388"}],"version-history":[{"count":3,"href":"http:\/\/www.diveintoaccessibility.com\/index.php\/wp-json\/wp\/v2\/posts\/1388\/revisions"}],"predecessor-version":[{"id":1402,"href":"http:\/\/www.diveintoaccessibility.com\/index.php\/wp-json\/wp\/v2\/posts\/1388\/revisions\/1402"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.diveintoaccessibility.com\/index.php\/wp-json\/wp\/v2\/media\/1390"}],"wp:attachment":[{"href":"http:\/\/www.diveintoaccessibility.com\/index.php\/wp-json\/wp\/v2\/media?parent=1388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.diveintoaccessibility.com\/index.php\/wp-json\/wp\/v2\/categories?post=1388"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.diveintoaccessibility.com\/index.php\/wp-json\/wp\/v2\/tags?post=1388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}