From be32c2f8daa3621e077cd8632aa81b47287a133f Mon Sep 17 00:00:00 2001 From: Chris Antes Date: Mon, 21 Jul 2014 21:08:08 -0700 Subject: [PATCH] Redefining default keymaps to avoid conflicts with default Atom keymaps. Closely matches what comes with the Sublime Text plugin. --- README.md | 52 +++++++++++++++++++++--------------------- keymaps/emmet.cson | 56 ++++++++++++++++++++++++++++++++++------------ 2 files changed, 69 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index e25b123..ae35aa2 100644 --- a/README.md +++ b/README.md @@ -33,31 +33,33 @@ Please report any problems at [issue tracker](https://github.com/emmetio/emmet-a You can change these Preferences > Emmet. -* / ⌘⇧E: Expand Abbreviation -* ⌘⌥⏎: Expand Abbreviation (interactive) -* ⌃W: Wrap with Abbreviation -* ⌃D: Balance (outward) -* ⌥D: Balance (inward) -* ⌃⌥J: Go to Matching Pair -* ⌃→: Next Edit Point -* ⌃←: Previous Edit Point -* ⌃⇧→: Select Next Item -* ⌃⇧←: Select Previous Item -* /: Toggle Comment -* ⌘J: Split/Join Tag -* ': Remove Tag -* ⌘Y: Evaluate Math Expression -* ⌃⌥↑: Increment Number by 0.1 -* ⌃⌥↓: Decrement Number by 0.1 -* ⌃⌥⌘↑: Increment Number by 1 -* ⌃⌥⌘↓: Decrement Number by 1 -* ⌃⌥⌘⇧↑: Increment Number by 10 -* ⌃⌥⌘⇧↓: Decrement Number by 10 -* ⌘R: Reflect CSS value -* ⌃I: Update Image Size -* ⌃⇧I: Encode/Decode image to data:URL -* ⌃U: Update Tag -* ⌘M: Merge Lines +Command | Darwin | Linux/Windows +------- | ------ | ------------- +Expand Abbreviation | tab or shift + + e | tab or ctrl + e +Expand Abbreviation (interactive) | alt + + enter | ctrl + alt + enter +Wrap with Abbreviation | ctrl + w | ctrl + alt + w +Balance (outward) | ctrl + d | ctrl + , +Balance (inward) | alt + d | ctrl + shift + 0 +Go to Matching Pair | ctrl + alt + j | ctrl + alt + j +Next Edit Point | ctrl + | ctrl + alt + +Previous Edit Point | ctrl + | ctrl + alt + +Select Next Item | ctrl + shift + | ctrl + shift + . +Select Previous Item | ctrl + shift + | ctrl + shift + , +Toggle Comment | + / | ctrl + shift + / +Split/Join Tag | shift + + j | ctrl + shift + ` +Remove Tag | + ' | ctrl + shift + ; +Evaluate Math Expression | shift + + y | ctrl + shift + y +Increment Number by 0.1 | ctrl + alt + | alt + +Decrement Number by 0.1 | ctrl + alt + | alt + +Increment Number by 1 | ctrl + alt + + | ctrl + +Decrement Number by 1 | ctrl + alt + + | ctrl + +Increment Number by 10 | ctrl + alt + + shift + | shift + alt + +Decrement Number by 10 | ctrl + alt + + shift + | shift + alt + +Reflect CSS value | shift + + r | ctrl + shift + r +Update Image Size | ctrl + i | ctrl + u +Encode/Decode image to data:URL | ctrl + shift + i | ctrl + ' +Update Tag | ctrl + shift + u | ctrl + shift + ' +Merge Lines | shift + + m | ctrl + shift + m All actions and their keyboard shortcuts are available under Packages > Emmet menu item. diff --git a/keymaps/emmet.cson b/keymaps/emmet.cson index 7f2c95d..080ffee 100644 --- a/keymaps/emmet.cson +++ b/keymaps/emmet.cson @@ -1,13 +1,44 @@ '.editor:not(.mini)': - 'cmd-E': 'emmet:expand-abbreviation' + 'ctrl-e': 'emmet:expand-abbreviation' + 'ctrl-,': 'emmet:balance-outward' + 'ctrl-shift-0': 'emmet:balance-inward' + 'ctrl-alt-j': 'emmet:matching-pair' + 'ctrl-alt-right': 'emmet:next-edit-point' + 'ctrl-alt-left': 'emmet:prev-edit-point' + 'ctrl-shift-`': 'emmet:split-join-tag' + 'ctrl-shift-;': 'emmet:remove-tag' + 'ctrl-shift-y': 'emmet:evaluate-math-expression' + 'alt-up': 'emmet:increment-number-by-01' + 'alt-down': 'emmet:decrement-number-by-01' + 'ctrl-up': 'emmet:increment-number-by-1' + 'ctrl-down': 'emmet:decrement-number-by-1' + 'alt-shift-up': 'emmet:increment-number-by-10' + 'alt-shift-down': 'emmet:decrement-number-by-10' + 'ctrl-shift-.': 'emmet:select-next-item' + 'ctrl-shift-,': 'emmet:select-previous-item' + 'ctrl-shift-r': 'emmet:reflect-css-value' + 'ctrl-u': 'emmet:update-image-size' + "ctrl-'": 'emmet:encode-decode-data-url' + "ctrl-shift-'": 'emmet:update-tag' + 'ctrl-shift-m': 'emmet:merge-lines' + 'ctrl-alt-w': 'emmet:wrap-with-abbreviation' + 'ctrl-alt-enter': 'emmet:interactive-expand-abbreviation' + +# more specificity to Emmet to override Tab key action for snippets plugin +'.pane .editor:not(.mini)': + 'tab': 'emmet:expand-abbreviation-with-tab' + 'ctrl-shift-/': 'emmet:toggle-comment' + 'enter': 'emmet:insert-formatted-line-break-only' + +'.platform-darwin .editor:not(.mini)': + 'cmd-shift-e': 'emmet:expand-abbreviation' 'ctrl-d': 'emmet:balance-outward' 'alt-d': 'emmet:balance-inward' - 'ctrl-alt-j': 'emmet:matching-pair' 'ctrl-right': 'emmet:next-edit-point' 'ctrl-left': 'emmet:prev-edit-point' - 'cmd-J': 'emmet:split-join-tag' + "cmd-shift-j": 'emmet:split-join-tag' "cmd-'": 'emmet:remove-tag' - 'cmd-Y': 'emmet:evaluate-math-expression' + 'cmd-shift-y': 'emmet:evaluate-math-expression' 'ctrl-alt-up': 'emmet:increment-number-by-01' 'ctrl-alt-down': 'emmet:decrement-number-by-01' 'ctrl-alt-cmd-up': 'emmet:increment-number-by-1' @@ -16,16 +47,13 @@ 'ctrl-alt-cmd-shift-down': 'emmet:decrement-number-by-10' 'ctrl-shift-right': 'emmet:select-next-item' 'ctrl-shift-left': 'emmet:select-previous-item' - 'cmd-R': 'emmet:reflect-css-value' - 'ctrl-I': 'emmet:update-image-size' - 'ctrl-shift-I': 'emmet:encode-decode-data-url' - 'ctrl-U': 'emmet:update-tag' - 'cmd-M': 'emmet:merge-lines' + 'cmd-shift-r': 'emmet:reflect-css-value' + 'ctrl-i': 'emmet:update-image-size' + "ctrl-shift-i": 'emmet:encode-decode-data-url' + 'ctrl-shift-u': 'emmet:update-tag' + 'cmd-shift-m': 'emmet:merge-lines' 'ctrl-w': 'emmet:wrap-with-abbreviation' - 'cmd-alt-enter': 'emmet:interactive-expand-abbreviation' + 'alt-cmd-enter': 'emmet:interactive-expand-abbreviation' -# more specificity to Emmet to override Tab key action for snippets plugin -'.pane .editor:not(.mini)': - 'tab': 'emmet:expand-abbreviation-with-tab' +'.platform-darwin .pane .editor:not(.mini)': 'cmd-/': 'emmet:toggle-comment' - 'enter': 'emmet:insert-formatted-line-break-only'