Tab

Overview

Cursor Tab is our native autocomplete feature. It's a more powerful Copilot with exceptionally good memory that can provide complete diff suggestions.

Powered by a custom model, Cursor Tab can:

  • Provide edit suggestions around the cursor, not just insert additional code.
  • Modify multiple lines of code simultaneously.
  • Offer suggestions based on your recent changes and linter errors.

Free users get 2000 suggestions for free. Pro and Business plan users get unlimited suggestions.

User Interface

When Cursor is only adding additional text, completions appear as gray text. If the suggestion modifies existing code, it appears as a diff popup to the right of the current line.

https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/cpp/ghost-text-example.png

https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/cpp/preview-box-example.png

You can press Tab to accept suggestions or Esc to reject them. To partially accept suggestions word by word, press Ctrl/⌘ →. To reject a suggestion, simply continue typing, or use Escape to cancel/hide the suggestion.

Cursor attempts to provide suggestions based on your recent changes with every keystroke or cursor movement. However, Cursor won't always show suggestions; sometimes the model predicts that no changes are needed.

Cursor can modify content from one line above to two lines below the current line.

Toggle

To turn this feature on or off, hover over the "Cursor Tab" icon in the status bar at the bottom right of the application.

Common Questions

What should I do if Tab interferes when writing comments?

You can disable Cursor Tab in comments by going to Cursor Settings > Tab Completion and unchecking "Trigger in comments".

Migrating from GitHub Copilot

Tab Improvements

The biggest difference between Cursor and GitHub Copilot is in how they handle code completion.

GitHub Copilot can only insert text at the cursor position. It cannot edit code around the cursor or delete text.

Cursor can not only insert text at the cursor but can do much more:

  • Multi-character edits

https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/cpp/multi-edit.png

  • Instruction-based edits

https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/cpp/instruct.png

Additionally, Cursor keeps a history of your recent changes in its context window, so it knows what you're going to do next.

Migrating from GitHub Copilot

Since Cursor comes with GitHub Copilot by default, you might have both GitHub Copilot and Cursor installed. We recommend turning off GitHub Copilot when using Cursor.

By default, Cursor takes precedence over GitHub Copilot. If you want to use GitHub Copilot, you can disable Cursor in settings.

Advanced Features

Tab in Preview

You can also use Cursor Tab in the "Go to Definition" or "Go to Type Definition" preview view. This is particularly useful when adding new parameters to function calls.

https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/cpp/cpp-in-peek.png

We especially like using it with gd in vim, for example, to modify a function definition and fix all places using it at once.

Cursor Prediction

Cursor can also predict where you'll go after accepting an edit. If available, you can press tab to go to the next location, allowing you to complete edits by pressing tab consecutively.

https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/cpp/cp.png

Cursor predicted the next location and provided an edit suggestion there.

Partial Acceptance

You can accept the next word of a suggestion by pressing Ctrl/⌘ and the right arrow key (or by setting editor.action.inlineSuggest.acceptNextWord to your preferred shortcut).

To enable partial acceptance, navigate to Cursor Settings > Features > Cursor Tab.