vscode 中的 TAB 和 ENTER 问题 [英] Issue with TAB and ENTER in vscode

查看:60
本文介绍了vscode 中的 TAB 和 ENTER 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,几个月来我一直在使用 Visual Studio 代码,我喜欢它.但是,有一件事让我厌倦了处理.

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 有一个糟糕的习惯,当我在输入结束时按 TAB 或 ENTER 时更改我的文本.例如,假设我正在写一些东西,我想在几个标签上做标签.举个例子:

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:

我输入fix",意思是,我在最后点击了 Tab,这样我就可以在几列上进行 Tab.当我这样做时,我的行更改为:

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>"(希望这看起来不奇怪,我不得不编辑标签不会被隐藏)

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

因此,为了在右侧进行 Tab 以进行内嵌评论或其他内容,我必须在点击 Tab 之前点击 SPACE.跛脚.

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?

我在 Mac 上使用 vscode.我禁用并卸载了所有扩展程序...仍然会发生.

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

推荐答案

是的,我已经被这个问题困扰了好几天了,直到现在我发布问题后我才弄清楚.这两个设置解决了我的问题:

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 是制表符问题,第二个输入时接受建议,即使没有显示任何建议.希望这对其他人有帮助...

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...

这篇关于vscode 中的 TAB 和 ENTER 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆