getcursor / cursor

The AI Code Editor
https://cursor.com
25.45k stars 1.58k forks source link

Multi Cursor - CMD+D, CMD+K, CMD+D #2356

Open fasani-tx opened 2 weeks ago

fasani-tx commented 2 weeks ago

Maybe this helps some one else.

It seems one issue with cursor is that it breaks multi-cursor selection (not sure if that is meant to be a weird inside cursor joke) but yes CMD+D, CMD+D, CMD+D, CMD+K, CMD+D the skip selection K command activates the AI popup, if you are a productive person you likely know about and use multi-cursor often (if you know, you know).

You can put it in your custom keybindings.json config. You can press CMD+SHIFT+P search for >key json and you will find the Open Keyboard Shortcuts option do not modify the Default one.

This rebinds cursor’s AI popup to CTRL+K and it brings back the multi-cursor CMD+D, CMD+K functionality.

  [{
    "key": "ctrl+k",
    "command": "aipopup.action.modal.generate",
    "when": "editorFocus && !composerBarIsVisible && !composerControlPanelIsVisible"
  },
  {
    "key": "cmd+k",
    "command": "-aipopup.action.modal.generate",
    "when": "editorFocus && !composerBarIsVisible && !composerControlPanelIsVisible"
  },
  {
    "key": "cmd+d",
    "command": "editor.action.addSelectionToNextFindMatch",
    "when": "editorFocus"
  },
  {
    "key": "cmd+k cmd+d",
    "command": "editor.action.moveSelectionToNextFindMatch",
    "when": "editorFocus"
  }]