Use cmd instead of command

This commit is contained in:
Matt Colyer 2013-11-19 15:29:37 -08:00
parent 1e4504e7f3
commit 55e90f8ae1
6 changed files with 110 additions and 110 deletions

View File

@ -10,51 +10,51 @@
'shift-end': 'editor:select-to-end-of-line'
# Sublime Parity
'command-a': 'core:select-all'
'command-alt-p': 'editor:log-cursor-scope'
'cmd-a': 'core:select-all'
'cmd-alt-p': 'editor:log-cursor-scope'
'ctrl-t': 'editor:transpose'
'command-k command-u': 'editor:upper-case'
'command-k command-l': 'editor:lower-case'
'cmd-k cmd-u': 'editor:upper-case'
'cmd-k cmd-l': 'editor:lower-case'
'.editor:not(.mini)':
# Atom Specific
'alt-command-z': 'editor:checkout-head-revision'
'command-<': 'editor:scroll-to-cursor'
'alt-cmd-z': 'editor:checkout-head-revision'
'cmd-<': 'editor:scroll-to-cursor'
'ctrl-C': 'editor:copy-path'
'alt-command-ctrl-f': 'editor:fold-selection'
'command-=': 'editor:auto-indent'
'alt-cmd-ctrl-f': 'editor:fold-selection'
'cmd-=': 'editor:auto-indent'
# Sublime Parity
'tab': 'editor:indent'
'enter': 'editor:newline'
'command-enter': 'editor:newline-below'
'command-shift-enter': 'editor:newline-above'
'command-]': 'editor:indent-selected-rows'
'command-[': 'editor:outdent-selected-rows'
'cmd-enter': 'editor:newline-below'
'cmd-shift-enter': 'editor:newline-above'
'cmd-]': 'editor:indent-selected-rows'
'cmd-[': 'editor:outdent-selected-rows'
'shift-tab': 'editor:outdent-selected-rows'
'ctrl-command-up': 'editor:move-line-up'
'ctrl-command-down': 'editor:move-line-down'
'command-/': 'editor:toggle-line-comments'
'command-j': 'editor:join-line'
'command-D': 'editor:duplicate-line'
'ctrl-cmd-up': 'editor:move-line-up'
'ctrl-cmd-down': 'editor:move-line-down'
'cmd-/': 'editor:toggle-line-comments'
'cmd-j': 'editor:join-line'
'cmd-D': 'editor:duplicate-line'
'ctrl-K': 'editor:delete-line'
'ctrl-shift-up': 'editor:add-selection-above'
'ctrl-shift-down': 'editor:add-selection-below'
'command-alt-[': 'editor:fold-current-row'
'command-alt-]': 'editor:unfold-current-row'
'command-alt-{': 'editor:fold-all' # Atom Specific
'command-alt-}': 'editor:unfold-all' # Atom Specific
'command-k command-0': 'editor:unfold-all'
'command-k command-1': 'editor:fold-at-indent-level-1'
'command-k command-2': 'editor:fold-at-indent-level-2'
'command-k command-3': 'editor:fold-at-indent-level-3'
'command-k command-4': 'editor:fold-at-indent-level-4'
'command-k command-5': 'editor:fold-at-indent-level-5'
'command-k command-6': 'editor:fold-at-indent-level-6'
'command-k command-7': 'editor:fold-at-indent-level-7'
'command-k command-8': 'editor:fold-at-indent-level-8'
'command-k command-9': 'editor:fold-at-indent-level-9'
'cmd-alt-[': 'editor:fold-current-row'
'cmd-alt-]': 'editor:unfold-current-row'
'cmd-alt-{': 'editor:fold-all' # Atom Specific
'cmd-alt-}': 'editor:unfold-all' # Atom Specific
'cmd-k cmd-0': 'editor:unfold-all'
'cmd-k cmd-1': 'editor:fold-at-indent-level-1'
'cmd-k cmd-2': 'editor:fold-at-indent-level-2'
'cmd-k cmd-3': 'editor:fold-at-indent-level-3'
'cmd-k cmd-4': 'editor:fold-at-indent-level-4'
'cmd-k cmd-5': 'editor:fold-at-indent-level-5'
'cmd-k cmd-6': 'editor:fold-at-indent-level-6'
'cmd-k cmd-7': 'editor:fold-at-indent-level-7'
'cmd-k cmd-8': 'editor:fold-at-indent-level-8'
'cmd-k cmd-9': 'editor:fold-at-indent-level-9'
'.tool-panel':
'escape': 'core:close'
@ -76,11 +76,11 @@
'backspace': 'native!'
'shift-backspace': 'native!'
'delete': 'native!'
'command-z': 'native!'
'command-Z': 'native!'
'command-x': 'native!'
'command-c': 'native!'
'command-v': 'native!'
'cmd-z': 'native!'
'cmd-Z': 'native!'
'cmd-x': 'native!'
'cmd-c': 'native!'
'cmd-v': 'native!'
'ctrl-b': 'native!'
'ctrl-f': 'native!'
'ctrl-F': 'native!'

View File

@ -1,10 +1,10 @@
'body.platform-darwin':
# Apple specific
'command-q': 'application:quit'
'command-h': 'application:hide'
'command-H': 'application:hide-other-applications'
'command-m': 'application:minimize'
'alt-command-ctrl-m': 'application:zoom'
'cmd-q': 'application:quit'
'cmd-h': 'application:hide'
'cmd-H': 'application:hide-other-applications'
'cmd-m': 'application:minimize'
'alt-cmd-ctrl-m': 'application:zoom'
'ctrl-p': 'core:move-up'
'ctrl-n': 'core:move-down'
@ -18,36 +18,36 @@
'ctrl-d': 'core:delete'
# Atom Specific
'command-O': 'application:open-dev'
'command-alt-ctrl-s': 'application:run-all-specs'
'cmd-O': 'application:open-dev'
'cmd-alt-ctrl-s': 'application:run-all-specs'
'enter': 'core:confirm'
'escape': 'core:cancel'
'up': 'core:move-up'
'down': 'core:move-down'
'left': 'core:move-left'
'right': 'core:move-right'
'ctrl-alt-command-r': 'window:reload'
'alt-command-i': 'window:toggle-dev-tools'
'command-alt-ctrl-p': 'window:run-package-specs'
'ctrl-alt-cmd-r': 'window:reload'
'alt-cmd-i': 'window:toggle-dev-tools'
'cmd-alt-ctrl-p': 'window:run-package-specs'
# Sublime Parity
'command-,': 'application:show-settings'
'command-N': 'application:new-window'
'command-W': 'window:close'
'command-o': 'application:open'
'command-T': 'pane:reopen-closed-item'
'command-n': 'application:new-file'
'command-s': 'core:save'
'command-S': 'core:save-as'
'command-alt-s': 'window:save-all'
'command-w': 'core:close'
'command-ctrl-f': 'window:toggle-full-screen'
'command-z': 'core:undo'
'command-Z': 'core:redo'
'command-y': 'core:redo'
'command-x': 'core:cut'
'command-c': 'core:copy'
'command-v': 'core:paste'
'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-Z': 'core:redo'
'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'
@ -57,46 +57,46 @@
'pagedown': 'core:page-down'
'backspace': 'core:backspace'
'shift-backspace': 'core:backspace'
'command-up': 'core:move-to-top'
'command-down': 'core:move-to-bottom'
'command-shift-up': 'core:select-to-top'
'command-shift-down': 'core:select-to-bottom'
'command-{': 'pane:show-previous-item'
'command-}': 'pane:show-next-item'
'command-alt-left': 'pane:show-previous-item'
'command-alt-right': 'pane:show-next-item'
'command-=': 'window:increase-font-size'
'command-+': 'window:increase-font-size'
'command--': 'window:decrease-font-size'
'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'
'cmd-alt-right': 'pane:show-next-item'
'cmd-=': 'window:increase-font-size'
'cmd-+': 'window:increase-font-size'
'cmd--': 'window:decrease-font-size'
'command-k up': 'pane:split-up' # Atom Specific
'command-k down': 'pane:split-down' # Atom Specific
'command-k left': 'pane:split-left' # Atom Specific
'command-k right': 'pane:split-right' # Atom Specific
'command-k command-w': 'pane:close' # Atom Specific
'command-k alt-command-w': 'pane:close-other-items' # Atom Specific
'command-k command-left': 'window:focus-previous-pane'
'command-k command-right': 'window:focus-next-pane'
'command-1': 'pane:show-item-1'
'command-2': 'pane:show-item-2'
'command-3': 'pane:show-item-3'
'command-4': 'pane:show-item-4'
'command-5': 'pane:show-item-5'
'command-6': 'pane:show-item-6'
'command-7': 'pane:show-item-7'
'command-8': 'pane:show-item-8'
'command-9': 'pane:show-item-9'
'cmd-k up': 'pane:split-up' # Atom Specific
'cmd-k down': 'pane:split-down' # Atom Specific
'cmd-k left': 'pane:split-left' # Atom Specific
'cmd-k right': 'pane:split-right' # Atom Specific
'cmd-k cmd-w': 'pane:close' # Atom Specific
'cmd-k alt-cmd-w': 'pane:close-other-items' # Atom Specific
'cmd-k cmd-left': 'window:focus-previous-pane'
'cmd-k cmd-right': 'window:focus-next-pane'
'cmd-1': 'pane:show-item-1'
'cmd-2': 'pane:show-item-2'
'cmd-3': 'pane:show-item-3'
'cmd-4': 'pane:show-item-4'
'cmd-5': 'pane:show-item-5'
'cmd-6': 'pane:show-item-6'
'cmd-7': 'pane:show-item-7'
'cmd-8': 'pane:show-item-8'
'cmd-9': 'pane:show-item-9'
'body.platform-darwin .editor':
# Apple Specific
'command-backspace': 'editor:backspace-to-beginning-of-line'
'command-delete': 'editor:backspace-to-beginning-of-line'
'cmd-backspace': 'editor:backspace-to-beginning-of-line'
'cmd-delete': 'editor:backspace-to-beginning-of-line'
'ctrl-A': 'editor:select-to-first-character-of-line'
'ctrl-E': 'editor:select-to-end-of-line'
'command-left': 'editor:move-to-first-character-of-line'
'command-right': 'editor:move-to-end-of-line'
'command-shift-left': 'editor:select-to-first-character-of-line'
'command-shift-right': 'editor:select-to-end-of-line'
'cmd-left': 'editor:move-to-first-character-of-line'
'cmd-right': 'editor:move-to-end-of-line'
'cmd-shift-left': 'editor:select-to-first-character-of-line'
'cmd-shift-right': 'editor:select-to-end-of-line'
'alt-backspace': 'editor:backspace-to-beginning-of-word'
'alt-delete': 'editor:delete-to-end-of-word'
'ctrl-a': 'editor:move-to-first-character-of-line'

View File

@ -45,10 +45,10 @@
'ctrl-k down': 'pane:split-down' # Atom Specific
'ctrl-k left': 'pane:split-left' # Atom Specific
'ctrl-k right': 'pane:split-right' # Atom Specific
'ctrl-k command-w': 'pane:close' # Atom Specific
'ctrl-k alt-command-w': 'pane:close-other-items' # Atom Specific
'ctrl-k command-left': 'window:focus-previous-pane'
'ctrl-k command-right': 'window:focus-next-pane'
'ctrl-k cmd-w': 'pane:close' # Atom Specific
'ctrl-k alt-cmd-w': 'pane:close-other-items' # Atom Specific
'ctrl-k cmd-left': 'window:focus-previous-pane'
'ctrl-k cmd-right': 'window:focus-next-pane'
'body.platform-win32 .editor':
# Windows specific

View File

@ -26,7 +26,7 @@ describe "Keymap", ->
beforeEach ->
keymap.bindKeys 'name', '.command-mode', 'x': 'deleteChar'
keymap.bindKeys 'name', '.insert-mode', 'x': 'insertChar'
keymap.bindKeys 'name', '.command-mode', 'command-z': 'commandZPressed'
keymap.bindKeys 'name', '.command-mode', 'cmd-z': 'commandZPressed'
deleteCharHandler = jasmine.createSpy('deleteCharHandler')
insertCharHandler = jasmine.createSpy('insertCharHandler')
@ -294,9 +294,9 @@ describe "Keymap", ->
describe "when ctrl, alt or command is pressed with a non-modifier key", ->
it "returns a string that identifies the key pressed", ->
expect(keymap.keystrokeStringForEvent(keydownEvent('a', altKey: true))).toBe 'alt-a'
expect(keymap.keystrokeStringForEvent(keydownEvent('[', metaKey: true))).toBe 'command-['
expect(keymap.keystrokeStringForEvent(keydownEvent('[', metaKey: true))).toBe 'cmd-['
expect(keymap.keystrokeStringForEvent(keydownEvent('*', ctrlKey: true))).toBe 'ctrl-*'
expect(keymap.keystrokeStringForEvent(keydownEvent('left', ctrlKey: true, metaKey: true, altKey: true))).toBe 'alt-ctrl-command-left'
expect(keymap.keystrokeStringForEvent(keydownEvent('left', ctrlKey: true, metaKey: true, altKey: true))).toBe 'alt-ctrl-cmd-left'
describe "when shift is pressed when a non-modifer key", ->
it "returns a string that identifies the key pressed", ->
@ -317,10 +317,10 @@ describe "Keymap", ->
describe "when multiple bindings match a keystroke", ->
it "only returns bindings that match the most specific selector", ->
keymap.bindKeys 'name', '.command-mode', 'g': 'command-mode'
keymap.bindKeys 'name', '.command-mode .grandchild-node', 'g': 'command-and-grandchild-node'
keymap.bindKeys 'name', '.command-mode', 'g': 'cmd-mode'
keymap.bindKeys 'name', '.command-mode .grandchild-node', 'g': 'cmd-and-grandchild-node'
keymap.bindKeys 'name', '.grandchild-node', 'g': 'grandchild-node'
bindings = keymap.keyBindingsMatchingElement(fragment.find('.grandchild-node'))
expect(bindings).toHaveLength 3
expect(bindings[0].command).toEqual "command-and-grandchild-node"
expect(bindings[0].command).toEqual "cmd-and-grandchild-node"

View File

@ -137,7 +137,7 @@ class ApplicationMenu
modifiers.push("Shift") if key != key.toLowerCase()
modifiers = modifiers.map (modifier) ->
modifier.replace(/shift/ig, "Shift")
.replace(/command/ig, "Command")
.replace(/cmd/ig, "Command")
.replace(/ctrl/ig, "Ctrl")
.replace(/alt/ig, "Alt")

View File

@ -6,7 +6,7 @@ CSON = require 'season'
KeyBinding = require './key-binding'
{Emitter} = require 'emissary'
Modifiers = ['alt', 'control', 'ctrl', 'shift', 'command']
Modifiers = ['alt', 'control', 'ctrl', 'shift', 'cmd']
# Internal: Associates keymaps with actions.
#
@ -79,7 +79,7 @@ class Keymap
if event.ctrlKey and key not in Modifiers
modifiers.push 'ctrl'
if event.metaKey and key not in Modifiers
modifiers.push 'command'
modifiers.push 'cmd'
if event.shiftKey and key not in Modifiers
isNamedKey = key.length > 1