vscode-emacs-friendly

June 6, 2019 ยท View on GitHub

This plugin provides emacs keybindings and workflow for Visual Studio Code and is a fork of the great vscode extension by hiro-sun.

It merges some of the pull requests in the original and other external helpers that make the extension a little less an exact copy of emacs behavior, and a little more friendly in interacting with the system clipboard and normal vscode interactions.

The following are some of the changes and enhancements from the original:

  • The clipboard handling is simplified by the removal of the emacs-only kill ring (which was also an unfinished implementation in the original). Copy, Cut, Yank and C-K work with the system clipboard now.
  • C+x k to close tab, C+x C-k all tabs
  • C+l centers screen on the cursor line
  • C+x C+f bound to quick open file
  • yank overwrites selection

Move commands

CommandDesc
C-fMove forward
C-bMove backward
C-nMove to the next line
C-pMove to the previous line
C-aMove to the beginning of line
C-eMove to the end of line
M-fMove forward by one word unit
M-bMove backward by one word unit
M->Move to the end of buffer
M-<Move to the beginning of buffer
C-vScroll down by one screen unit
M-vScroll up by one screen unit
M-g gJump to line (command palette)
M-g nJump to next error
M-g pJump to previous error
C-lCenter screen on current line

Search Commands

CommandDesc
C-sSearch forward
C-rSearch backward
A-%Replace
C-EnterReplace One Match (In replace dialog)
C-M-nAdd selection to next find match

Edit commands

CommandDesc
C-dDelete right (DEL)
C-hDelete left (BACKSPACE)
M-dDelete word
M-BkspDelete word left
C-kKill to line end
C-S-BkspKill entire line
C-oopen-line
C-wKill region
M-wCopy region to kill ring
C-yYank
C-jEnter
C-mEnter
C-x C-oDelete blank lines around
C-x hSelect All
C-x u (C-/, C-_)Undo
C-;Toggle line comment in and out
M-;Toggle region comment in and out
C-x C-lConvert to lower case
C-x C-uConvert to upper case

Other Commands

CommandDesc
C-gCancel
C-spaceSet mark
C-quoteIntelliSense Suggestion
M-xOpen command palette
C-M-SPCToggle SideBar visibility
C-x z
C-x r

File Commands

CommandDesc
C-x C-sSave
C-x C-wSave as
C-x C-nOpen new window

Tab / Buffer Manipulation Commands

CommandDesc
C-x bSwitch to another open buffer
C-x C-fQuickOpen a file
C-x kClose current tab (buffer)
C-x C-kClose all tabs
C-x 0Close editors in the current group.
C-x 1Close editors in other (split) group.
C-x 2Split editor horizontal
C-x 3Split editor vertical
C-x 4Toggle split layout (vertical to horizontal)
C-x oFocus other split editor

Conflicts with default key bindings

  • ctrl+d: editor.action.addSelectionToNextFindMatch => Use ctrl+alt+n instead;
  • ctrl+g: workbench.action.gotoLine => Use alt+g g instead;
  • ctrl+b: workbench.action.toggleSidebarVisibility => Use ctrl+alt+space instead;
  • ctrl+space: toggleSuggestionDetails, editor.action.triggerSuggest => Use ctrl+' instead;
  • ctrl+x: editor.action.clipboardCutAction => Use ctrl+w instead;
  • ctrl+v: editor.action.clipboardPasteAction => Use ctrl+y instead;
  • ctrl+k: editor.debug.action.showDebugHover, editor.action.trimTrailingWhitespace, editor.action.showHover, editor.action.removeCommentLine, editor.action.addCommentLine, editor.action.openDeclarationToTheSide;
  • ctrl+k z: workbench.action.toggleZenMode => Use ctrl+x z instead;
  • ctrl+y: redo;
  • ctrl+m: editor.action.toggleTabFocusMode;
  • ctrl+/: editor.action.commentLine => Use ctrl+; instead;
  • ctrl+p & ctrl+e: workbench.action.quickOpen => Use ctrl+x b instead;
  • ctrl+p: workbench.action.quickOpenNavigateNext => Use ctrl+n instead.
  • ctrl+o: workbench.action.files.openFile => Use ctrl+x ctrl+f instead.
  • ctrl+r: workbench.action.openRecent => Use ctrl+x r instead.

More information

The logo is from the great Pacifica Icon Set.