Tab Autocomplete & Cmd+K
Master Cursor's Tab model for inline code predictions and Cmd+K for targeted inline editing — the two fastest ways to write code with AI.
Master Cursor's Tab model for inline code predictions and Cmd+K for targeted inline editing — the two fastest ways to write code with AI.
Tab is Cursor's inline autocomplete system. It is powered by a specialized model trained specifically for predicting your next code edit — not just what comes after your cursor, but what you are likely to change next anywhere on the screen.
To use it: just type. Ghost text appears showing Cursor's prediction. Press Tab to accept the entire suggestion, or hold Tab to accept word by word.
Standard autocomplete suggests what to type after your cursor. Cursor's Tab model predicts your next edit — it watches what you just changed and anticipates the related change you are about to make, even if it is on a different line.
For example, if you rename a parameter in a function signature, Tab will immediately suggest the corresponding rename in the function body.
| Action | Key |
|---|---|
| Accept full suggestion | Tab |
| Accept one word | Ctrl+Right (macOS: Cmd+Right) |
| Reject suggestion | Escape |
| Trigger manually | Start typing — suggestions appear automatically |
If you are using VS Code or the Cursor IDE, Next Edit Suggestions (NES) predict the location of your next edit and jump your cursor there automatically. This is useful after a refactor — Cursor walks you through every spot that needs updating.
Next Edit Suggestions work best on TypeScript, Python, and JavaScript. For other languages, standard Tab completions are still effective.
Cmd+K (Ctrl+K on Windows/Linux) opens the inline edit bar. It generates or rewrites code directly in the editor, showing you a diff before applying.
Place your cursor where you want new code, press Cmd+K, and describe what you want:
Write a debounce function with a configurable delay and immediate-execution option
Cursor generates the code inline. A diff is shown — green lines are additions:
+ function debounce(fn, delay, immediate = false) {
+ let timer;
+ return function (...args) {
+ const callNow = immediate && !timer;
+ clearTimeout(timer);
+ timer = setTimeout(() => {
+ timer = null;
+ if (!immediate) fn.apply(this, args);
+ }, delay);
+ if (callNow) fn.apply(this, args);
+ };
+ }Accept with Enter, reject with Escape, or type follow-up instructions to refine.
Select a block of code, press Cmd+K, then describe the transformation:
Convert this class component to a functional component with hooks
Cursor rewrites the selection in place and shows the diff. You review and accept.
| Scenario | Result | |---|---| | No selection, cursor on blank line | Generates new code at cursor | | Code selected | Rewrites the selection based on your instruction | | Cursor inside a function | Generates or replaces the nearest logical block |
The recommended workflow is:
For example: use Cmd+K to generate a new API route, then use Tab to let Cursor fill in the imports, update the router, and add the type definitions — without you having to navigate to each spot manually.
Tab suggestions disappear if you move your cursor away or start typing something different. If you want to re-trigger a suggestion, simply pause typing for about 300ms and it will reappear.
Tab handles continuous prediction-as-you-type; Cmd+K handles on-demand generation and rewrites. Together they eliminate most of the mechanical coding work. The next module covers Chat and Agent mode — where you give Cursor higher-level instructions and it plans and executes multi-file changes autonomously.