user791187
user791187

Reputation: 717

VS Code cursor appear as a block and without typical editing abilities

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.

enter image description here

When I start a new file, I cannot seem to get out of the bar state.

Upvotes: 4

Views: 14925

Answers (8)

Emmanuel Mensah
Emmanuel Mensah

Reputation: 11

Turn off the Num keys and press 0. That should fix it

Upvotes: 0

Emmanuel Mensah
Emmanuel Mensah

Reputation: 11

Back up necessary files and try relaunching the VS Code. That worked for me.

Upvotes: 0

SaniBro H
SaniBro H

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

johannesMatevosyan
johannesMatevosyan

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

user791187
user791187

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 be block 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 in Cannot edit in read-only editor tooltip appearing; that is the mode I get into when double-clicking a file listed in STAGED CHANGES in the Source Control pane. I'd recommend to disable all extensions in the Extensions pane, see if the problem goes away and then bisect

Upvotes: 3

Wang Shaoyun
Wang Shaoyun

Reputation: 101

You may have installed the Vim extension. Disabling or uninstalling it may solve the problem.

Upvotes: 10

Harshit Bhardwaj
Harshit Bhardwaj

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

Abhinav Khemka
Abhinav Khemka

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

Related Questions