[英]Atom editor - multiselect by line
I am moving from Sublime
to Atom
, and can't find a certain hotkey for the life of me.我正在从Sublime
转移到Atom
,并且无法为我的生活找到某个热键。
Control+D
will still do a multi-select - select the next instance your highlighted text, at which point you will get multiple cursors. Control+D
仍然会进行多选 - 选择下一个突出显示的文本实例,此时您将获得多个光标。
In Sublime
, if you selected multiple lines and pressed control+shift+l
, it would then create a cursor on each line, so you could edit each line at once.在Sublime
,如果您选择多行并按下control+shift+l
,它将在每一行上创建一个光标,因此您可以一次编辑每一行。
I looked through the hotkey lists for Atom
, and can't find this.我查看了Atom
的热键列表,但找不到它。 But then I probably don't know the right terminology.但是我可能不知道正确的术语。
我最近使用了这个包,但我不确定是否有热键: https ://atom.io/packages/sublime-style-column-selection
For Windows users,对于 Windows 用户,
the default keybindings ctrl + shift + up / down
seems to work.默认的键绑定ctrl + shift + up / down
似乎有效。
For Mac users,对于 Mac 用户,
add the following custom keybinding code to the将以下自定义键绑定代码添加到/user/<yourName>/.atom/keymap.cson
file /user/<yourName>/.atom/keymap.cson
文件
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# change the keybinding for ADD SELECTION ABOVE / BELOW
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 'shift-alt-up': 'editor:add-selection-above'
# 'shift-alt-down': 'editor:add-selection`-below'
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Then place the cursor where you want to start and press and hold shift + alt
and press up
or down
repeatedly to extend the cursor to as many lines as needed.然后将光标放在要开始的位置并按住shift + alt
并反复按up
或down
以将光标扩展到所需的行数。
The command in the menu Selection —> Split into Lines
should do what you want.菜单“ Selection —> Split into Lines
”中的命令应该可以执行您想要的操作。 On the Mac the keyboard shortcut is cmd-shift-l
.在 Mac 上,键盘快捷键是cmd-shift-l
。
Use the multi-cursor package .使用多光标包。
Use CTRL/COMMAND to select multiple places.使用 CTRL/COMMAND 选择多个位置。
Selection
--> Split into Lines
将键绑定添加到Selection
--> Split into Lines
To add the ctrl + shift + L Key-binding to this you need to edit your custom keymap file.要将ctrl + shift + L键绑定添加到此,您需要编辑自定义键盘映射文件。
Edit
--> Keymap...
:opens keymap.cson file Edit
--> Keymap Keymap...
:opens keymap.cson 文件Append to : keymap.cson附加到: keymap.cson
".platform-darwin atom-text-editor":
"ctrl-shift-j": "grammar-selector:show"
".platform-win32 atom-text-editor":
"ctrl-shift-j": "grammar-selector:show"
".platform-linux atom-text-editor":
"ctrl-shift-j": "grammar-selector:show"
Append to : keymap.cson附加到: keymap.cson
'.platform-darwin atom-text-editor:not([mini])':
'ctrl-shift-l': 'editor:split-selections-into-lines'
'.platform-win32 atom-text-editor:not([mini])':
'ctrl-shift-l': 'editor:split-selections-into-lines'
'.platform-linux atom-text-editor:not([mini])':
'ctrl-shift-l': 'editor:split-selections-into-lines'
Note: I have only tested this on linux.注意:我只在 linux 上测试过。 Note2: on mac , ie darwin
this may not be needed注2:在mac上,即darwin
这可能不需要
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.