【问题标题】:Add a command keymap ATOM添加命令键盘映射 ATOM
【发布时间】:2023-04-03 21:05:01
【问题描述】:

我想在 ATOM 键盘映射中添加一个命令。

ALT+j : 选择所有出现

但我不知道它是如何工作的,我只是简单地添加了 cmd+d。

这就是我现在拥有的:

'body':
  'cmd-,': 'application:show-settings'
  'cmd-N': 'application:new-window'
  'cmd-W': 'window:close'
  'cmd-o': 'application:open'
  'cmd-T': 'pane:reopen-closed-item'
  'cmd-n': 'application:new-file'
  'cmd-s': 'core:save'
  'cmd-S': 'core:save-as'
  'cmd-alt-s': 'window:save-all'
  'cmd-w': 'core:close'
  'cmd-ctrl-f': 'window:toggle-full-screen'
  'cmd-z': 'core:undo'
  'cmd-y': 'core:redo'
  'cmd-x': 'core:cut'
  'cmd-c': 'core:copy'
  'cmd-v': 'core:paste'
  'shift-up': 'core:select-up'
  'shift-down': 'core:select-down'
  'shift-left': 'core:select-left'
  'shift-right': 'core:select-right'
  'shift-pageup': 'core:select-page-up'
  'shift-pagedown': 'core:select-page-down'
  'delete': 'core:delete'
  'shift-delete': 'core:delete'
  'pageup': 'core:page-up'
  'pagedown': 'core:page-down'
  'backspace': 'core:backspace'
  'shift-backspace': 'core:backspace'
  'cmd-up': 'core:move-to-top'
  'cmd-down': 'core:move-to-bottom'
  'cmd-shift-up': 'core:select-to-top'
  'cmd-shift-down': 'core:select-to-bottom'
  'cmd-{': 'pane:show-previous-item'
  'cmd-}': 'pane:show-next-item'
  'cmd-alt-left': 'pane:show-previous-item'

'atom-workspace atom-text-editor:not([mini])':
  'cmd-d': 'editor:duplicate-lines'

【问题讨论】:

    标签: atom-editor keymapping


    【解决方案1】:

    这是我在由 Atom->Settings->Keybindings 选项卡/页面引导的 keymap.cson 文件中找到的:

    # Your keymap
    #
    # Atom keymaps work similarly to style sheets. Just as style sheets use
    # selectors to apply styles to elements, Atom keymaps use selectors to associate
    # keystrokes with events in specific contexts. Unlike style sheets however,
    # each selector can only be declared once.
    #
    # You can create a new keybinding in this file by typing "key" and then hitting
    # tab.
    #
    # Here's an example taken from Atom's built-in keymap:
    #
    # 'atom-text-editor':
    #   'enter': 'editor:newline'
    #
    # 'atom-workspace':
    #   'ctrl-shift-p': 'core:move-up'
    #   'ctrl-p': 'core:move-down'
    #
    # You can find more information about keymaps in these guides:
    # * http://flight-manual.atom.io/using-atom/sections/basic-customization/#_customizing_keybindings
    # * http://flight-manual.atom.io/behind-atom/sections/keymaps-in-depth/
    #
    # If you're having trouble with your keybindings not working, try the
    # Keybinding Resolver: `Cmd+.` on macOS and `Ctrl+.` on other platforms. See the
    # Debugging Guide for more information:
    # * http://flight-manual.atom.io/hacking-atom/sections/debugging/#check-the-keybindings
    #
    # This file uses CoffeeScript Object Notation (CSON).
    # If you are unfamiliar with CSON, you can read more about it in the
    # Atom Flight Manual:
    # http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson
    

    这里的链接非常丰富。看看这些——

    对于cson 的详细信息,请进一步转到Atom 飞行手册basic-customization 部分。

    希望这能给你一些指导!

    【讨论】:

    • 我已经看过这个链接,但它对我没有帮助,这就是我在 StackOverflow 中发布 subjet 的原因^^
    • '.platform-darwin atom-text-editor': 'alt-j' : 'find-and-replace:select-all'
    • @Riddick 对之前的失望感到抱歉,但是您可以在 keymap.cson 文件的末尾添加一组行,用于预期的工作:@987654326 @。但是,在 atom 中有一个相同的组合键:ctrl-cmd-g,它做同样的事情并且是默认的。您还可以先按 cmd-.,然后按您想要的,来验证您的组合键。
    • 哦,我没见过这个命令,是的,是一样的,对不起..
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-02
    相关资源
    最近更新 更多