DEV Community

Cover image for Settling the editors key bindings war
suntong
suntong

Posted on • Edited on

Settling the editors key bindings war

This SO question, Key bindings war in my brain, best summarized the problem I'm facing and am trying to solve:

How many key bindings are there in your brain? I personally use Intellij Idea as my primary IDE for development, but sometimes switch to Eclipse and Netbeans a bit, and sometimes I use Jedit, Notepad++, Emacs, Vim.

I am always trying to find a perfect key bindings that I can use crossing all the editors. What's your idea to solve this problem?

The question was asked over 10 years ago, and there is still no perfect solution to the problem. What's worse is that there is now another big player in the field now -- we need to add Microsoft Code to the above long list as well now.

There may be no perfect solution for anyone, but for me, having to constantly switch between Emacs, Jed, Goland, IntelliJ Idea, and Microsoft Code, I'm going to let them all to use the same keyboard mapping and bindings.

The most difficult part is not Goland, IntelliJ Idea, and Microsoft Code, contrary to people might think, but Emacs itself, as Emacs itself has no official standard for key mapping and bindings. For example, the other day I just realized that I have three different way for comment-or-uncomment: C-c ;, M-#, and M-;. Same for indents lines and/or region, I have defined at least three different ways as well.

Both Microsoft Code and IntelliJ has Emacs compatible mode which use Emacs key bindings. This post just collect them into a single place and put them side by side (if dev.to is restricting the blog width so you cannot see the full table width, you can also view it here):

Shortcut MS Code IntelliJ
C-' editor.action.triggerSuggest -
C-' toggleSuggestionDetails -
C-/ undo $Undo
C-; editor.action.commentLine -
C-CLOSE_BRACKET - EditorCodeBlockEnd
C-F10 - ToggleBookmark
C-F4 - CloseContent
C-HOME - EditorTextStart
C-M-/ - SmartTypeCompletion
C-M-; - Emacs+.CommentDwim
C-M-CLOSE_BRACKET - EditorCodeBlockEnd
C-M-F7 - ShowUsages
C-M-OPEN_BRACKET - EditorCodeBlockStart
C-M-S-5 - Emacs+.QueryReplaceRegexp
C-M-S-down - VcsShowNextChangeMarker
C-M-S-up - VcsShowPrevChangeMarker
C-M-a - MethodUp
C-M-b paredit.backwardSexp EditorPreviousWord
C-M-backspace - Emacs+.KillWordBackward
C-M-d - EditorCodeBlockEnd
C-M-delete - Emacs+.KillWordBackward
C-M-e - MethodDown
C-M-f paredit.forwardSexp EditorNextWord
C-M-g - GotoDeclaration
C-M-i - AutoIndentLines
C-M-j - Emacs+.CommentIndentNew
C-M-k paredit.killSexp EditorKillToWordEnd
C-M-k paredit.killSexp Emacs+.KillWord
C-M-n addSelectionToNextFindMatch -
C-M-p addSelectionToPreviousFindMatch -
C-M-q - AutoIndentLines
C-M-r - Emacs+.ISearchBackwardRegexp
C-M-s - Emacs+.ISearchForwardRegexp
C-M-s - Find
C-M-space workbench.toggleSidebarVisibility -
C-M-u - EditorCodeBlockStart
C-M-w - EditorSelectWord
C-M-w - Emacs+.AppendNextKill
C-M-w - Emacs+.ISDeleteChar
C-M-y - Emacs+.ISYankChar
C-OPEN_BRACKET - EditorCodeBlockStart
C-S-' editor.action.triggerParameterHints -
C-S-- undo -
C-S-2 setMarkCommand EditorToggleStickySelection
C-S-M-d - EditorCodeBlockEndWithSelection
C-S-M-u - EditorCodeBlockStartWithSelection
C-S-MINUS - $Undo
C-S-backspace killWholeLine Emacs+.KillWholeLine
C-S-down - EditorForwardParagraphWithSelection
C-S-space - SmartTypeCompletion
C-S-up - EditorBackwardParagraphWithSelection
C-S-x BACK_QUOTE - GotoPreviousError
C-S-z - $Redo
C-a moveBeginningOfLine EditorLineStart
C-b backwardChar EditorLeft
C-backspace - EditorDeleteToWordStart
C-backspace - Emacs+.KillWordBackward
C-c C-c - CommentByLineComment
C-c C-e - Diff.KeymapGroup
C-c C-n - StepOver
C-c C-p - EvaluateExpression
C-c C-r - Resume
C-c C-s - StepInto
C-c C-t - ToggleTemporaryLineBreakpoint
C-c C-u - RunToCursor
C-d deleteForwardChar $Delete
C-d deleteForwardChar Emacs+.ISForwardDelete
C-delete - Emacs+.KillWord
C-down - EditorForwardParagraph
C-e moveEndOfLine EditorLineEnd
C-end - EditorTextEnd
C-f forwardChar EditorRight
C-h deleteBackwardChar -
C-i executeCommands -
C-insert - $Copy
C-j newLine -
C-k killLine EditorCutLineEnd
C-k killLine Emacs+.KillLine
C-l recenterTopBottom EditorScrollToCenter
C-l recenterTopBottom Emacs+.Recenter
C-left - EditorPreviousWord
C-left - Emacs+.BackwardWord
C-n nextLine EditorDown
C-n nextLine Emacs+.TWSelectNext
C-n selectNextQuickFix EditorDown
C-n selectNextQuickFix Emacs+.TWSelectNext
C-n selectNextSuggestion EditorDown
C-n selectNextSuggestion Emacs+.TWSelectNext
C-n showNextParameterHint EditorDown
C-n showNextParameterHint Emacs+.TWSelectNext
C-n workbench.quickOpenSelectNext EditorDown
C-n workbench.quickOpenSelectNext Emacs+.TWSelectNext
C-o lineBreakInsert EditorSplitLine
C-p previousLine EditorUp
C-p selectPrevQuickFix Emacs+.TWSelectPrevious
C-r editor.action.previousMatchFindAction Emacs+.ISearchBackward
C-r editor.action.previousMatchFindAction FindPrevious
C-r isearchBackward Emacs+.ISearchBackward
C-r isearchBackward FindPrevious
C-right - EditorNextWord
C-right - Emacs+.ForwardWord
C-s editor.action.nextMatchFindAction Emacs+.ISearchForward
C-s editor.action.nextMatchFindAction Find
C-s isearchForward Emacs+.ISearchForward
C-s isearchForward Find
C-space setMarkCommand EditorToggleStickySelection
C-t - Emacs+.TransposeChars
C-u universalArgument -
C-u C-M-; - Emacs+.CommentKill
C-u M-. - GotoImplementation
C-u M-; - Emacs+.CommentKill
C-u M-CIRCUMFLEX - EditorJoinLines
C-u M-S-6 - EditorJoinLines
C-up - EditorBackwardParagraph
C-v scrollUpCommand EditorPageDown
C-v scrollUpCommand Emacs+.TWScrollUp
C-w killRegion EditorKillRegion
C-w killRegion Emacs+.ISYankNextWord
C-w killRegion Emacs+.KillRegion
C-x 0 workbench.closeEditorsInGroup CloseContent
C-x 1 workbench.closeEditorsInOtherGroups Emacs+.DeleteOtherWindows
C-x 1 workbench.closeEditorsInOtherGroups UnsplitAll
C-x 2 workbench.splitEditorDown SplitHorizontally
C-x 3 workbench.splitEditorRight SplitVertically
C-x 4 workbench.toggleEditorGroupLayout -
C-x BACK_QUOTE - GotoNextError
C-x BACK_QUOTE - GotoNextError
C-x C-c workbench.closeWindow CloseAllEditors
C-x C-f workbench.quickOpen GotoFile
C-x C-l transformToLowercase -
C-x C-n workbench.newWindow -
C-x C-o deleteBlankLines Emacs+.DeleteBlankLines
C-x C-o deleteBlankLines NextProjectWindow
C-x C-p - FileChooser.TogglePathShowing
C-x C-s workbench.files.save SaveAll
C-x C-t - Emacs+.TransposeLines
C-x C-u transformToUppercase -
C-x C-v - ReloadFromDisk
C-x C-w workbench.files.saveAs -
C-x C-x exchangePointAndMark Emacs+.ExchangePointAndMark
C-x EQUALS - Emacs+.WhatCursorPos
C-x ` editor.action.marker.next -
C-x b workbench.showAllEditorsByMostRecentlyUsed Emacs+.SwitchToBuffer
C-x ctrl-k workbench.closeAllEditors -
C-x h editor.action.selectAll $SelectAll
C-x j workbench.togglePanel -
C-x k workbench.closeActiveEditor CloseContent
C-x n - Diff.NextChange
C-x n - NextTab
C-x o workbench.navigateEditorGroups Emacs+.TWInterrupt
C-x o workbench.navigateEditorGroups NextSplitter
C-x p - Diff.PrevChange
C-x p - PreviousTab
C-x r startRectCommand -
C-x r M-w copyRectangleAsKill -
C-x r c clearRectangle -
C-x r d deleteRectangle -
C-x r k killRectangle -
C-x r o openRectangle -
C-x r y yankRectangle -
C-x s workbench.files.saveAll -
C-x space rectangleMarkMode ToggleLineBreakpoint
C-x u undo -
C-x v - Vcs.QuickListPopupAction
C-x x - EditorSwapSelectionBoundaries
C-x z workbench.toggleZenMode -
C-y yank $Paste
C-y yank Emacs+.ISYankLine
C-y yank Emacs+.Yank
C-z - EditorPageUp
F2 - GotoNextError
F2 - GotoNextError
F3 - FindNext
HOME - EditorLineStart
M-. - GotoDeclaration
M-. - GotoDeclaration
M-/ editor.action.triggerSuggest CodeCompletion
M-/ toggleSuggestionDetails CodeCompletion
M-; editor.action.blockComment CommentByLineComment
M-; editor.action.blockComment Emacs+.CommentDwim
M-AT - EditorSelectWord
M-BACK_/ - Emacs+.DeleteHorizSpace
M-CIRCUMFLEX - Emacs+.DeleteIndentation
M-F3 - Find
M-F7 - FindUsages
M-F7 - FindUsages
M-GREATER - EditorTextEnd
M-GREATER - Emacs+.TWEnd
M-LESS - EditorTextStart
M-LESS - Emacs+.TWBegin
M-MINUS C-k - EditorCutLineBackward
M-MINUS C-k - Emacs+.CutLineBackwardKey
M-S-, beginningOfBuffer -
M-S-. endOfBuffer EditorTextEnd
M-S-. endOfBuffer EditorTextEnd
M-S-. endOfBuffer Emacs+.TWEnd
M-S-2 - EditorSelectWord
M-S-5 editor.action.startFindReplaceAction Emacs+.QueryReplace
M-S-5 editor.action.startFindReplaceAction Replace
M-S-6 executeCommands Emacs+.DeleteIndentation
M-S-COMMA - EditorTextStart
M-S-COMMA - EditorTextStart
M-S-COMMA - Emacs+.TWBegin
M-S-MINUS - $Redo
M-S-[ backwardParagraph -
M-S-] forwardParagraph -
M-S-g - GotoClass
M-S-left - PreviousEditorTab
M-S-m - CompileProject
M-S-o - SelectVirtualTemplateElement
M-S-p - ParameterInfo
M-S-right - NextEditorTab
M-S-s - FindUsages
M-S-s - ShowUsages
M-b backwardWord EditorPreviousWord
M-b backwardWord Emacs+.BackwardWord
M-backspace backwardKillWord EditorDeleteToWordStart
M-c transformToTitlecase $Copy
M-c transformToTitlecase Emacs+.CapitalizeWord
M-c transformToTitlecase Emacs+.ISCase
M-d killWord EditorDuplicate
M-d killWord EditorKillToWordEnd
M-d killWord EditorKillToWordEnd
M-d killWord Emacs+.KillWord
M-delete - EditorKillToWordStart
M-delete - Emacs+.KillWordBackward
M-down - MethodDown
M-f forwardWord EditorNextWord
M-f forwardWord Emacs+.ForwardWord
M-g - GotoLine
M-g M-g workbench.gotoLine GotoLine
M-g M-n editor.action.marker.next GotoNextError
M-g M-p editor.action.marker.prev -
M-g g workbench.gotoLine GotoLine
M-g n editor.action.marker.next GotoNextError
M-g p editor.action.marker.prev -
M-i - EmacsStyleIndent
M-j - Emacs+.CommentIndentNew
M-l transformToLowercase Emacs+.DowncaseWord
M-left - Diff.PrevChange
M-left - Emacs+.BackwardWord
M-left - PreviousTab
M-m backToIndentation EditorLineStart
M-m backToIndentation Emacs+.BackToIndentation
M-m backToIndentation Emacs+.ISMultiLine
M-n - Emacs+.CommentNextLine
M-n - Emacs+.ISearchHistoryNext
M-p - Emacs+.CommentPreviousLine
M-p - Emacs+.ISearchHistoryPrevious
M-r - Emacs+.ISRegex
M-r - FindPrevious
M-right - Diff.NextChange
M-right - Emacs+.ForwardWord
M-right - NextTab
M-s - FindInPath
M-s - FindNext
M-space - Emacs+.JustOneSpace
M-t - Emacs+.TransposeWords
M-u transformToUppercase Emacs+.UpcaseWord
M-u transformToUppercase SynchronizeCurrentFile
M-up - MethodUp
M-v scrollDownCommand EditorPageUp
M-v scrollDownCommand Emacs+.TWScrollDown
M-w copyRegion EditorKillRingSave
M-w copyRegion Emacs+.SaveRegion
M-x workbench.showCommands GotoAction
M-y yank-pop Emacs+.YankPop
RET - Console.Execute
RET - EditorChooseLookupItem
RET - EditorEnter
RET - Emacs+.ISEnter
RET - NextTemplateVariable
S-F2 - GotoPreviousError
S-F3 - FindPrevious
S-delete - $Cut
S-insert - $Paste
TAB - EmacsStyleIndent
delete - $Delete
down nextLine EditorDown
down selectNextSuggestion EditorDown
down showNextParameterHint EditorDown
end moveEndOfLine EditorLineEnd
escape cancel -
escape cancel -
escape . - GotoDeclaration
escape . - GotoDeclaration
escape ; - Emacs+.CommentDwim
escape BACK_/ - Emacs+.DeleteHorizSpace
escape C-b - EditorPreviousWord
escape C-backspace - Emacs+.KillWordBackward
escape C-delete - Emacs+.KillWordBackward
escape C-f - EditorNextWord
escape C-j - Emacs+.CommentIndentNew
escape COMMA - EditorTextStart
escape b - Emacs+.BackwardWord
escape backspace - EditorDeleteToWordStart
escape c - Emacs+.CapitalizeWord
escape d - EditorKillToWordEnd
escape d - Emacs+.KillWord
escape delete - Emacs+.KillWordBackward
escape escape - EditorEscape
escape escape - EditorEscape
escape f - Emacs+.ForwardWord
escape g workbench.gotoLine -
escape j - Emacs+.CommentIndentNew
escape l - Emacs+.DowncaseWord
escape left - Emacs+.BackwardWord
escape m - Emacs+.BackToIndentation
escape n - Emacs+.CommentNextLine
escape p - Emacs+.CommentPreviousLine
escape right - Emacs+.ForwardWord
escape space setMarkCommand Emacs+.JustOneSpace
escape u - Emacs+.UpcaseWord
escape u - SynchronizeCurrentFile
escape w - $Copy
escape w - Emacs+.SaveRegion
escape x - GotoAction
escape y - Emacs+.YankPop
home moveBeginningOfLine -
left backwardChar EditorLeft
pagedown scrollUpCommand EditorPageDown
pageup scrollDownCommand EditorPageUp
right forwardChar EditorRight
up previousLine EditorUp
up selectPrevSuggestion EditorUp

PS.

If you are interested in how these key bindings are collected, check out

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more