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

View File

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

View File

@ -26,7 +26,7 @@ describe "Keymap", ->
beforeEach -> beforeEach ->
keymap.bindKeys 'name', '.command-mode', 'x': 'deleteChar' keymap.bindKeys 'name', '.command-mode', 'x': 'deleteChar'
keymap.bindKeys 'name', '.insert-mode', 'x': 'insertChar' 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') deleteCharHandler = jasmine.createSpy('deleteCharHandler')
insertCharHandler = jasmine.createSpy('insertCharHandler') insertCharHandler = jasmine.createSpy('insertCharHandler')
@ -294,9 +294,9 @@ describe "Keymap", ->
describe "when ctrl, alt or command is pressed with a non-modifier key", -> describe "when ctrl, alt or command is pressed with a non-modifier key", ->
it "returns a string that identifies the key pressed", -> it "returns a string that identifies the key pressed", ->
expect(keymap.keystrokeStringForEvent(keydownEvent('a', altKey: true))).toBe 'alt-a' 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('*', 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", -> describe "when shift is pressed when a non-modifer key", ->
it "returns a string that identifies the key pressed", -> it "returns a string that identifies the key pressed", ->
@ -317,10 +317,10 @@ describe "Keymap", ->
describe "when multiple bindings match a keystroke", -> describe "when multiple bindings match a keystroke", ->
it "only returns bindings that match the most specific selector", -> it "only returns bindings that match the most specific selector", ->
keymap.bindKeys 'name', '.command-mode', 'g': 'command-mode' keymap.bindKeys 'name', '.command-mode', 'g': 'cmd-mode'
keymap.bindKeys 'name', '.command-mode .grandchild-node', 'g': 'command-and-grandchild-node' keymap.bindKeys 'name', '.command-mode .grandchild-node', 'g': 'cmd-and-grandchild-node'
keymap.bindKeys 'name', '.grandchild-node', 'g': 'grandchild-node' keymap.bindKeys 'name', '.grandchild-node', 'g': 'grandchild-node'
bindings = keymap.keyBindingsMatchingElement(fragment.find('.grandchild-node')) bindings = keymap.keyBindingsMatchingElement(fragment.find('.grandchild-node'))
expect(bindings).toHaveLength 3 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.push("Shift") if key != key.toLowerCase()
modifiers = modifiers.map (modifier) -> modifiers = modifiers.map (modifier) ->
modifier.replace(/shift/ig, "Shift") modifier.replace(/shift/ig, "Shift")
.replace(/command/ig, "Command") .replace(/cmd/ig, "Command")
.replace(/ctrl/ig, "Ctrl") .replace(/ctrl/ig, "Ctrl")
.replace(/alt/ig, "Alt") .replace(/alt/ig, "Alt")

View File

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