PyCharm: 将选择变为每行多个光标
PyCharm: Turning selection to multiple cursors per line
Sublime Text 具有此功能,您可以在其中 select 文本并使用(多个)光标开始编辑每一行:
有PyCharm等价物吗?
来自 source:
To add carets, do one of the following
Press Shift+Alt and click the LEFT
mouse button at the location of the caret.
Double-click Ctrl and press up arrow or down arrow keys.
在 OSX 上,按下 LEFT
-ALT 并用鼠标 LEFT CLICK
添加新插入符似乎就足够了,或者按下 SHIFT+ALT 并用鼠标绘制光标。
另一个选项:选择文本,切换列选择模式:
切换模式的默认快捷方式是:
- Linux/Windows:
alt
-shift
-insert
- Mac
cmd
-shift
-(numpad) *
(或Edit
→Column Selection Mode
)
对于 Mac 来说这是一个不方便的快捷方式,因为大多数笔记本电脑都没有小键盘。我将其重新映射为 cmd
-shift
-8
.
列选择模式实际上还有其他用途:它改变了使用键盘和鼠标选择文本时的默认行为。再次将其关闭以 return 为正常选择行为。
按住 Alt
并将鼠标拖到所需的文本上。
来源:https://www.jetbrains.com/help/pycharm/2016.1/selecting-text-in-the-editor.html
我认为最简单的方法是 select 文本并继续按 Alt + J for Linux 和 Ctrl + G for Mac 直到你到达最后一场比赛。
PyCharm 中 MacOS X 的类似 Sublime 的功能:
Select/Unselect 下一个 出现 Ctrl+G
/ Shift+Ctrl+G
Select all 一次出现 Ctrl+Cmd+G
删除 ESC
的匹配项
要在 Linux 上执行此操作(在 Ubuntu 16.04 上测试),请执行以下操作:
在您的编辑器中,按 Alt
+ Windows Key
并使用鼠标将光标放在您希望有多个光标的行上。
您可能还想 allow placement of caret after the end of line
或 inside tabs
。在这种情况下,您需要更改设置:
转到Editor -> Generaral -> Virtual Space:
- [x] 允许在行尾后放置插入符
- [x] 允许在选项卡内放置插入符
并确保启用上述两个设置。
您可以使用插件 Extra Actions.
您必须为此操作添加组合:
Split Selection into Lines
默认没有设置快捷方式。
您可以前往
轻松设置它们
Settings > Keymap > Plugins > Extra Actions
在 pycharm 中按 SHIFT + 向下箭头键(而不是鼠标拖动)进行多光标编辑
对于 macOS 用户:如果您按住 shift
+ down
或 up
箭头键到 select 看起来就像多个游标。
image
此功能已添加到 June 2020 中的 Pycharm。
它被称为“将插入符号添加到所选行的末尾”,并且绑定到 Alt + Shift + 默认G.
您可以对 selected 行使用 alt + shift + G
来为它们启用插入符号,并使用 Home
和 End
按钮转到行首或行尾(s).
- select 你的线路。
- 按
alt + shift + G
- 按
Home
或 End
转到行首或行尾。
您也可以使用 alt + click
通过单击 selecting 和 alt + J
到 select 相同的值。
Sublime Text 具有此功能,您可以在其中 select 文本并使用(多个)光标开始编辑每一行:
有PyCharm等价物吗?
来自 source:
To add carets, do one of the following
Press Shift+Alt and click the
LEFT
mouse button at the location of the caret.Double-click Ctrl and press up arrow or down arrow keys.
在 OSX 上,按下 LEFT
-ALT 并用鼠标 LEFT CLICK
添加新插入符似乎就足够了,或者按下 SHIFT+ALT 并用鼠标绘制光标。
另一个选项:选择文本,切换列选择模式:
切换模式的默认快捷方式是:
- Linux/Windows:
alt
-shift
-insert
- Mac
cmd
-shift
-(numpad) *
(或Edit
→Column Selection Mode
)
对于 Mac 来说这是一个不方便的快捷方式,因为大多数笔记本电脑都没有小键盘。我将其重新映射为 cmd
-shift
-8
.
列选择模式实际上还有其他用途:它改变了使用键盘和鼠标选择文本时的默认行为。再次将其关闭以 return 为正常选择行为。
按住 Alt
并将鼠标拖到所需的文本上。
来源:https://www.jetbrains.com/help/pycharm/2016.1/selecting-text-in-the-editor.html
我认为最简单的方法是 select 文本并继续按 Alt + J for Linux 和 Ctrl + G for Mac 直到你到达最后一场比赛。
PyCharm 中 MacOS X 的类似 Sublime 的功能:
Select/Unselect 下一个 出现 Ctrl+G
/ Shift+Ctrl+G
Select all 一次出现 Ctrl+Cmd+G
删除 ESC
要在 Linux 上执行此操作(在 Ubuntu 16.04 上测试),请执行以下操作:
在您的编辑器中,按 Alt
+ Windows Key
并使用鼠标将光标放在您希望有多个光标的行上。
您可能还想 allow placement of caret after the end of line
或 inside tabs
。在这种情况下,您需要更改设置:
转到Editor -> Generaral -> Virtual Space:
- [x] 允许在行尾后放置插入符
- [x] 允许在选项卡内放置插入符
并确保启用上述两个设置。
您可以使用插件 Extra Actions.
您必须为此操作添加组合:
Split Selection into Lines
默认没有设置快捷方式。
您可以前往
轻松设置它们Settings > Keymap > Plugins > Extra Actions
在 pycharm 中按 SHIFT + 向下箭头键(而不是鼠标拖动)进行多光标编辑
对于 macOS 用户:如果您按住 shift
+ down
或 up
箭头键到 select 看起来就像多个游标。
image
此功能已添加到 June 2020 中的 Pycharm。
它被称为“将插入符号添加到所选行的末尾”,并且绑定到 Alt + Shift + 默认G.
您可以对 selected 行使用 alt + shift + G
来为它们启用插入符号,并使用 Home
和 End
按钮转到行首或行尾(s).
- select 你的线路。
- 按
alt + shift + G
- 按
Home
或End
转到行首或行尾。
您也可以使用 alt + click
通过单击 selecting 和 alt + J
到 select 相同的值。