在PyCharm中使用Alt +←/→在下划线分隔的单词之间移动

时间:2013-12-12 20:50:10

标签: python pycharm shortcuts

在PyCharm中,当我使用Alt + ←/→快捷键在单词之间移动时,它会在空格分隔的单词之间移动光标。如何让它在underscore_seperated_words

之间移动光标

2 个答案:

答案 0 :(得分:22)

选项不明显,但是如果我勾选Editor -> General -> Smart Keys -> Use "CamelHumps" words,那么当在Alt + ←/→的单词之间移动时,我可以介于下划线分隔的单词之间,而不仅仅是空格分隔的“单词”。 同样适用于camelCase的单词。

答案 1 :(得分:0)

如果你想要两个空格分隔的功能和camelCase分隔的光标移动和选择,Editor Actions下的键映射中有一些选项叫做:

  • Move Caret to Next Word
  • Move Caret to Next Word in Different "CamelHumps" Mode
  • Move Caret to Next Word with Selection in Different "CamelHumps" Mode
  • Move Caret to Pervious Word
  • Move Caret to Previous Word in Different "CamelHumps" Mode
  • Move Caret to Previous Word with Selection in Different "CamelHumps" Mode

由于我主要使用Ctrl + ←/→的常规光标移动,我为Alt + ←/→模式添加了"CamelHumps"。如上所述,CamelCase也适用于下划线。