Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make VSCode to replace the word when accepting autocomplete hint?

JetBrains IDE platform have very useful feature, which I am using a lot and I find it a performance booster. When I have a word in editor, and I want to change or update that word, I do the following.

  • Place cursor in front of the word (or in middle, ex. when I want to change only last part.)
  • Start typing until I got autocomplete I want to use.
  • Press TAB or ENTER.
    • On TAB - Old word is completely replaced by new word. This is especially useful when I update some names, in which beginning of word is the same, but ending is different. For example, change getTimeInSeconds() to getTimeInMinutes() - I put cursor after getTimeIn, get autocomplete, and press TAB. Nothing left to delete, everything is replaced.
    • On ENTER - New word is replaced from the start of old word, but right part from the cursor stays on screen.

By default VSCode supports only "ENTER" use case. Does it support "TAB" use case? If so, how to enable it?

like image 781
wst Avatar asked Jan 31 '17 01:01

wst


1 Answers

You can set this using the "editor.suggest.insertMode" setting. If you set this to "replace", it will behave as you want.

like image 145
laszlo_kiss Avatar answered Sep 22 '22 16:09

laszlo_kiss