Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with TAB and ENTER in vscode

So, Ive been using Visual Studio code now for several months, and I love it. BUT, there is one thing that is driving me nuts that I'm tired of dealing with.

VSCode has a terrible habit of changing my text when i hit TAB or ENTER at the end of typing. For example, Let's say I'm writing something and I want to tab over a few tabs. So, as an example:

I type "fix", meaning, i hit tab at the end so I can tab over a few columns. When I do this, my line changes to:

"<fix></fix>" (hope this doesnt looks weird, I had to edit to the tags wouldnt be hidden)

So, in order to tab to the right for in-line comments or something, I have to hit SPACE before i hit tab. Lame.

Similar stuff happens when I hit enter immediately after typing something. It changes my text to something else before leaving the line. So, again, I find myself adding an extra space at the end of every line.

Does an extra space hurt me in the long run? No. But my OCD is freaking out over it.

I dont have tab autocomplete turned on, so why is this behaving as such?

I'm using vscode on a Mac. I disabled and uninstalled all extensions... still happens.

like image 605
R. Smith Avatar asked Jan 05 '23 12:01

R. Smith


1 Answers

So yeah, I've messed with this for days, and only now after I post a question do I figure it out. These two settings took care of my issues:

// When enabled, emmet abbreviations are expanded when pressing TAB.
"emmet.triggerExpansionOnTab": false,

// Controls if suggestions should be accepted 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions.
"editor.acceptSuggestionOnEnter": false        

Emmet was the tab issue, and the accept suggestion on enter was the second, even though no suggestion was showing. Hope this helps someone else...

like image 105
R. Smith Avatar answered Apr 13 '23 19:04

R. Smith