【问题标题】:Configure code folding in Atom to mimic PatentStorm在 Atom 中配置代码折叠以模仿 PatentStorm
【发布时间】:2018-10-20 12:03:48
【问题描述】:

在PatentStorm中,我使用了Ctrl+W — Ctrl+Shift+W 折叠 / 展开代码。

我迁移到 Atom —— 这可以模仿吗?

【问题讨论】:

  • 伙计们,这个问题不是题外话,因为所讨论的工具主要用于编程。
  • 你试过我的解决方案吗?

标签: atom-editor keymapping


【解决方案1】:

自定义键盘映射

将此添加到您的键盘映射中:

'atom-text-editor':
  'ctrl-w': 'editor:fold-current-row'
  'ctrl-shift-w': 'editor:unfold-current-row'

Atom Keymaps In-Depth


Atom 默认值 (Windows)

您可以通过单击出现的箭头来折叠代码块 您将鼠标光标悬停在排水沟上。你也可以折叠和 使用 Alt+Ctrl+[Alt从键盘展开>+Ctrl+] 键绑定。

Atom Code Folding

单键折叠切换

如果您想使用键绑定来折叠切换,请创建自定义命令:

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?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-11-06
    • 2016-10-26
    • 2017-03-10
    • 1970-01-01
    • 2018-10-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多