【发布时间】:2018-10-20 12:03:48
【问题描述】:
在PatentStorm中,我使用了Ctrl+W — Ctrl+Shift+W 折叠 / 展开代码。
我迁移到 Atom —— 这可以模仿吗?
【问题讨论】:
-
伙计们,这个问题不是题外话,因为所讨论的工具主要用于编程。
-
你试过我的解决方案吗?
在PatentStorm中,我使用了Ctrl+W — Ctrl+Shift+W 折叠 / 展开代码。
我迁移到 Atom —— 这可以模仿吗?
【问题讨论】:
将此添加到您的键盘映射中:
'atom-text-editor':
'ctrl-w': 'editor:fold-current-row'
'ctrl-shift-w': 'editor:unfold-current-row'
您可以通过单击出现的箭头来折叠代码块 您将鼠标光标悬停在排水沟上。你也可以折叠和 使用 Alt+Ctrl+[ 和 Alt从键盘展开>+Ctrl+] 键绑定。
如果您想使用键绑定来折叠切换,请创建自定义命令:
atom.commands.add 'atom-text-editor', 'editor:toggle-current-row-folding': (event) -> editor = @getModel() bufferRow = editor.bufferPositionForScreenPosition(editor.getCursorScreenPosition()).row if editor.isFoldedAtBufferRow(bufferRow) editor.unfoldBufferRow(bufferRow) else editor.foldBufferRow(bufferRow)
在这里你可以使用'editor:toggle-current-row-folding' 作为你的命令。
来自 abe + kschaper @ How to toggle current fold in editor view?
【讨论】: