英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论