1

When auto-completing, most editors either overwrite the word your cursor is in front, or just insert the completion without touching any other text. Atom has a happy medium between the two that I really like, but is a bit hard to put into words. It basically replaces any part of the word that is a suffix of the completion. Let me give some examples, the pipe (|) is the cursor and in each example, we autocomplete "HelloWorld":

  • Hello|You -> HelloWorld|You
  • Hello|World -> HelloWorld|
  • Hello|InTheWorld -> HelloWorld|InTheWorld
  • Hello|rld1234 -> HelloWorld|1234

I've found that this rarely gets it wrong, without me needing to think about whether I wanted to replace something or not. And having gotten used to it, I find both the other options (always replacing and never replacing) do something I didn't want often.

I'm finally looking at switching away from Atom. Is there a way to make autocomplete work in VS Code the way it does in Atom?

starball
  • 20,030
  • 7
  • 43
  • 238
Jasper
  • 11,590
  • 6
  • 38
  • 55

1 Answers1

2

In Bash / readline / inputrc, this feature (or something very similar to it)'s setting is called skip-completed-text. As far as my knowledge goes, VS Code just has a setting called editor.suggest.insertMode, which (at the time of this writing), only has "insert" (never replace anything) and "replace" (always replace the following text range- as defined by the language extension for the current language mode (or something like that)) as options (and some associated keyboard shortcut binding points).

So (and I hope I'm right about this- I'm not 100% confident), the correct next step if you really want such a feature is to raise it as a feature-request to the VS Code maintainers, probably as a new value to the existing editor.suggest.insertMode setting. If you do that, make sure to describe in detail how it should behave (Ex. showing the example you've shown in your question post here), and please either comment under this answer post with a link to your feature request, or suggest an edit to this answer post to add a link to it. You'll need to get a certain number of thumbs up reactions within a certain time period if you want it to get added to the backlog, so I'd suggest to promote your feature request to your friends / peers / colleagues, and on dev platforms like r/vscode.

starball
  • 20,030
  • 7
  • 43
  • 238
  • Good explanation of the situation. I might make a feature request at some point. I'm a bit hesitant because it's an absolute shame that feature requests are a popularity contest rather than being judged on their merits... – Jasper Aug 25 '23 at 09:20