Reputation: 717
After some configuration, my cursor in VS Code started appearing as a block. In that state, I'm not able to backspace or edit any of the code. In a saved file with code already written, I can hit the "I" key, and it changes the cursor back to the standard bar with editing capabilities.
When I start a new file, I cannot seem to get out of the bar state.
Upvotes: 4
Views: 14925
Reputation: 11
Back up necessary files and try relaunching the VS Code. That worked for me.
Upvotes: 0
Reputation: 179
I recently found out that this happens when you're in insert mode. Press the Ins key again (this will vary depending on your hardware) and the problem will be solved.
Upvotes: 17
Reputation: 2228
I used Shift + Numpad 0
combination (On some keyboards, Shift combined with Numpad 0 acts as the Insert
key) and it helped me.
Upvotes: 4
Reputation: 717
I ended up following the advice from V-R. I disabled all the extensions and then re-activated everything I needed - that did the trick!
Which extensions are enabled and what version of VSCode do you have? There is a setting
Editor: Cursor Style
which can beblock
but it only affects the appearance, may not have anything to do with being unable to edit code. There is a read-only mode where (at least in 1.39.1) trying to edit results inCannot edit in read-only editor
tooltip appearing; that is the mode I get into when double-clicking a file listed inSTAGED CHANGES
in theSource Control
pane. I'd recommend to disable all extensions in theExtensions
pane, see if the problem goes away and then bisect
Upvotes: 3
Reputation: 101
You may have installed the Vim extension. Disabling or uninstalling it may solve the problem.
Upvotes: 10
Reputation: 21
You may have accidentally toggled "Vim mode" in Visual Studio Code. Just go to the command palette and search for Vim: Toggle Vim Mode
and click it once.
Happened with me sometime back.
Upvotes: 0
Reputation: 39
Try pressing the key i. I was having the same issues but every time I have this issue, pressing the i key helped and enabled normal editing with a normal cursor.
Upvotes: 3