Enter key behaviour

Grateful for any help here. I’m sure this is something simple but I can’t seem to figure it out.

I was trying to manually edit files and it looks like default VS Code behaviour for the Enter key wasn’t working on my set up.

The behaviour I was getting is that hitting Enter didn’t create a new line inside an open file.

With the help of Grok, I’ve now got a workaround, which is to add the below to keybindings.json:

{
    "key": "enter",
    "command": "type",
    "args": { "text": "\n" },
    "when": "editorTextFocus && !editorReadonly"
  }

But this seems ridiculous to get basic behaviour. It feels like more of a hack than the actual solution.

I’ve never had an issue with this in the past (I’ve used VS Code for years). I swapped to Cursor about 3 months ago. Everything was working fine but I recently changed to a new device and I wasn’t able to add a line break to code by hitting Enter.

Among the various things I tried, I could hit control + enter to add a line below the line I’m on but this doesn’t split code onto a new line. Vim mode is also off.

Am I going crazy here or is there something else at play?

Hey, that’s quite a strange error. The issue might be related to an extension.

1 Like

Good suggestion. That did come up in my debugging efforts but I couldn’t quickly pin it down to a specific extension. Maybe I should investigate that angle more. Thanks for the input