I can't seem to find any way to put the cursor into 'overwrite' mode - as in when you press the insert key and newly typed characters overwrite the existing characters inline. I haven't found any reference anywhere online to the omission or inclusion of such a feature in VS Code, but it seems to be a fairly commonly used feature. Does this exist?
6 Answers
I too was missing the overtype mode in Visual Studio Code, so I went ahead and wrote an Overtype extension to add the behavior!
You can install it by opening the command palette and entering:
ext install overtype
Update: As of this writing (August 2022), VS Code still does not have overtype built in, and the original extension seems to be no longer maintained. There is a more up-to-date fork here.
-
25the one time I actually need this stupid button and I didn't hit it on accident....– CodyCommented Oct 18, 2017 at 15:47
-
1another possibility can be to use another editor in the rare occasions overwrite is desired.– citykidCommented Jun 13, 2020 at 18:21
-
24 years later it seems that @Adam Maras extension is in the catalog: Name: Overtype Id: adammaras.overtype Description: Provides insert/overtype mode. Version: 0.2.0 Publisher: Adam Maras VS Marketplace Link: marketplace.visualstudio.com/items?itemName=adammaras.overtype– zielotCommented Feb 4, 2021 at 18:23
-
3The original extension seems to be abandoned. Here is a fork with several updates: marketplace.visualstudio.com/items?itemName=DrMerfy.overtype Commented Jul 1, 2021 at 15:11
-
1Please notice (at least) the updated fork also overwrites the
ctrl+shift-I
keybinding from 'Format Document' to 'Toggle Insert/Overwrite'– nualaCommented Jul 12, 2023 at 11:53
For me, I think it's because of an extension called Vim (Vim emulation for Visual Studio Code). I was tired of this problem. Just going through all the extensions and settings, Finally I found this solution. By uninstalling this Vim extension I was free of this error.
-
Vim (Vim emulation for Visual Studio Code) extension name. Commented Aug 21, 2022 at 16:07
-
8
-
I don't have this extension installed and I still have this problem. Commented Jul 24, 2023 at 22:49
-
Thanks buddy. Have been searching it for a very long time. This saved my day. Commented May 16 at 9:43
It seems to be working fine for me both ways I can switch it with shift + i on latest VS Code and macOS system.
The best I can do is highlight the text I want to replace with the mouse and then start typing. It sorta works.
-
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review– MarkCommented Aug 5, 2023 at 9:49
-
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.– Community BotCommented Aug 9, 2023 at 9:16
It's not built in to VS Code at the time of this writing. If you want it to be, you should give a thumbs up to the relevant feature-request: Insert key doesn't switch to overtype/overwrite mode #1012, which will increase its prioritization. You can also subscribe to it to get notified about discussion and progress. Please avoid making noisy comments there like ones that just consist of "+1" / "bump". It's pretty high in the prioritization list (going by thumbs up reactions, at the time of this writing, it's #26, so keep the thumbs-ups coming and wait patiently).
As others have mentioned, you can install an extension which enables such behaviour, such as the adammaras.overtype
extension, or its more up-to-date fork, DrMerfy.overtype
(I have no affiliation with these extensions). Note that it purportedly has issues with non-ASCII characters (source).
Useless note: There's also an issue ticket for this in the monaco repo: overwrite mode #86671, but it's closed to track the discussion in the corresponding VS Code issue ticket (I told you this note was useless). Somewhat less useless note: If you're building something with monaco, You might want to see this comment there.
You can follow these steps:
- Open the Extensions view in Visual Studio Code by clicking on the Extensions icon on the left-hand side of the editor or by pressing ctrl+shift+X (Windows/Linux) or cmd+shift+ (Mac).
- Search for "Vim" in the search bar.
- Click on the gear icon next to the "Vim" extension and select "Disable" from the dropdown menu.