简体   繁体   English

如何用花括号或引号包裹一个单词而不是删除它? - 使用 Visual Studio 的 Python

[英]How to wrap a word with curly braces or quotation marks instead of erasing it? - Python using Visual Studio

I'm starting to learn Python using Visual Studio and something that is bugging me out is that, when I select a variable and press " or { , instead of wrapping it and leaving it like "variable" or {variable} , it just erases the variable and leaves behind the " or the { .我开始使用 Visual Studio 学习 Python,令我烦恼的是,当我选择一个变量并按"{时,而不是将其包装起来并像"variable"{variable}一样保留它,它只是擦除变量并留下"{

Is there any way to configure Visual Studio so it does what I want?有什么方法可以配置 Visual Studio 让它做我想要的吗?

Look for "Auto Surround" in the "Preferences - Settings" (it has a search box).在“首选项 - 设置”中查找“自动环绕”(它有一个搜索框)。

I has several settings to determine when it should be applied, one of them is "never".我有几个设置来确定何时应用它,其中之一是“从不”。

显示设置中的自动环绕的屏幕截图

If it is set to languageDefined , it's possible it's not set up for the language you're writing in, or disabled specifically for that.如果它设置为languageDefined ,则可能没有为您正在编写的语言设置它,或者专门为此禁用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM