如何使用快捷键同时更改代码中的变量名称和所有变量出现的地方?

huangapple go评论64阅读模式
英文:

How do you change variable name and all occurrences of the variable in your code at the same time with a shortcut?

问题

我想知道是否有一个键盘快捷键可以更改代码中变量的名称,但可以同时更改代码中变量的所有出现。

双击变量总是会突出显示其他出现的地方,所以我想知道它是否已经为我提供了建议?

如何使用快捷键同时更改代码中的变量名称和所有变量出现的地方?

我尝试搜索快捷键,但没有找到有用的结果。

英文:

I was wondering if there was a keyboard shortcut to change a variable's name in your code but in a way that I can do it for all of the occurrences of the variable in your code at the same time.

Double-clicking a variable always highlighted the other occurrences so I wondered if it was already suggesting it to me?

如何使用快捷键同时更改代码中的变量名称和所有变量出现的地方?

I tried searching up shortcuts with no helpful results.

答案1

得分: 0

如果您正在使用VS-Code

高亮显示变量名称,然后按下CTRL+Shift+L。然后将您的变量名称更改为您想要的内容。

如果您正在使用Sublime Text

在Windows和Linux上按Alt+F3,在Mac OS上按CTRL+Cmd+G

如果您正在使用PyCharm

在Windows和Linux上按CTRL+Shift+Alt+J,在Mac OS上按Ctrl+Cmd+G,或者按照bigkreifer所说按Shift+F6

我知道,我尝试阅读文档,但文档全都是荷兰语,我无法完全理解其中的内容,所以我试图猜测您实际使用的IDE(集成开发环境,只是一个更高级的文本编辑器)。

英文:

If you're using VS-Code

Highlight the variable name and press CTRL+Shift+L. Then change your variable's name to whatever you want.

If you're using Sublime Text

Alt+F3 on Windows and Linux, or CTRL+Cmd+G on Mac OS.

If you're using PyCharm

CTRL+Shift+Alt+J on Windows and Linux, Ctrl+Cmd+G on Mac OS, or Shift+F6 as said by bigkreifer

I know, I tried to read the documentation, but it's all in dutch and I can't quite understand what it was written, so I'm trying to guess what IDE (Integreated Developing Enviroment, just a fancier text editor) you are actually using

huangapple
  • 本文由 发表于 2023年2月26日 19:57:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/75571807.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定