All Projects → whitphx → Vscode Emacs Mcx

whitphx / Vscode Emacs Mcx

Licence: other
Awesome Emacs Keymap - VSCode emacs keybinding with multi cursor support

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Vscode Emacs Mcx

Doxdocgen
Generate doxygen documentation from source code in VS Code
Stars: ✭ 127 (-5.93%)
Mutual labels:  hacktoberfest, vscode, vscode-extension
Svn Scm
SVN support for VS Code
Stars: ✭ 172 (+27.41%)
Mutual labels:  hacktoberfest, vscode, vscode-extension
Vscode Stylelint
Official Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 141 (+4.44%)
Mutual labels:  hacktoberfest, vscode, vscode-extension
Vscode Org Mode
Emacs Org Mode for Visual Studio Code
Stars: ✭ 1,096 (+711.85%)
Mutual labels:  vscode, vscode-extension, emacs
Nim
Streamline Your Node.js Debugging Workflow with Chromium (Chrome, Edge, More) DevTools.
Stars: ✭ 168 (+24.44%)
Mutual labels:  hacktoberfest, vscode, vscode-extension
Css Flexbox Cheatsheet
VS Code extension that lets you open a CSS Flexbox cheatsheet directly in the editor.
Stars: ✭ 87 (-35.56%)
Mutual labels:  hacktoberfest, vscode, vscode-extension
Vscode Go
Go extension for Visual Studio Code
Stars: ✭ 2,268 (+1580%)
Mutual labels:  vscode, vscode-extension
Mypy boto3 builder
Type annotations builder for boto3 compatible with VSCode, PyCharm, Emacs, Sublime Text, pyright and mypy.
Stars: ✭ 123 (-8.89%)
Mutual labels:  vscode, emacs
Vs Swagger Viewer
Swagger Viewer lets you preview and validate Swagger 2.0 and OpenAPI files as you type in Visual Studio Code.
Stars: ✭ 126 (-6.67%)
Mutual labels:  vscode, vscode-extension
Markdown Toc
MarkdownTOC(Table Of Contents) Plugin for Visual Studio Code.
Stars: ✭ 130 (-3.7%)
Mutual labels:  vscode, vscode-extension
Vscode Postgres
PostgreSQL extension for vscode providing explorer, highlighting, diagnostics, and intellisense
Stars: ✭ 117 (-13.33%)
Mutual labels:  vscode, vscode-extension
Vscode Scss
🔌 IntelliSense for Variables, Mixins and Functions in all Sass (SCSS syntax only) files.
Stars: ✭ 128 (-5.19%)
Mutual labels:  vscode, vscode-extension
Vscode Browse Lite
🚀 An embedded browser in VS Code
Stars: ✭ 134 (-0.74%)
Mutual labels:  vscode, vscode-extension
Vscode Verilog Hdl Support
Verilog HDL/SystemVerilog/Bluespec SystemVerilog support for VS Code
Stars: ✭ 120 (-11.11%)
Mutual labels:  hacktoberfest, vscode
Vscode Language Pascal
Pascal language extension for Visual Studio Code
Stars: ✭ 117 (-13.33%)
Mutual labels:  vscode, vscode-extension
Vscode Apielements
VSCode extensions for API Elements (aka: API Blueprint and Swagger)
Stars: ✭ 117 (-13.33%)
Mutual labels:  vscode, vscode-extension
Vscode Elastic
Elasticsearch for VSCode
Stars: ✭ 130 (-3.7%)
Mutual labels:  vscode, vscode-extension
Coddx Alpha
Coddx - a collection of tools that help developers program efficiently. One of the features is generating multiple files from templates quickly.
Stars: ✭ 132 (-2.22%)
Mutual labels:  vscode, vscode-extension
Quicktype Vscode
VS Code extension to convert JSON to TypeScript, C#, Go, and many more
Stars: ✭ 131 (-2.96%)
Mutual labels:  vscode, vscode-extension
Vscode Neovim
VSCode Neovim Integration
Stars: ✭ 2,474 (+1732.59%)
Mutual labels:  vscode, vscode-extension

Awesome Emacs Keymap (emacs-mcx)

CI Status

Visual Studio Marketplace Version Visual Studio Marketplace Installs - Azure DevOps Extension Visual Studio Marketplace Rating

Open VSX Version Open VSX Downloads Open VSX Rating

GitHub Sponsors

Buy Me A Coffee

This Visual Studio Code extension provides emacs-like keybindings and operations. This is inspired by the great vscode extension by hiro-sun and its forks such as vscode-emacs-friendly by Sebastian Zaha, vscode-emacs-improved by rkwan94 and vscode-emacs-neon by NotKyon.

Though there were such great extensions, this extension is written from scratch because it was hard to achieve the goal listed below by extending the existent code base.

This extension aims

  • to provide emacs-like keybindings
  • to be fully compatible with multi cursor
  • to support kill-ring integrated with the system clipboard
  • to support mark-ring
  • to support prefix argument
  • to support sexp
  • to fix some bugs in the existing extensions such as
    • mark-mode states are shared amoung all editors

This extension makes use of code in the existent extensions listed above and, in addition, VSCode and VSCode Vim extension. Thanks to all these great works. Mainly, almost all keybinding settings are derived from vscode-emacs-friendly by Sebastian Zaha.

Recommended VSCode settings

Extension settings

This extension has some custom settings named with a prefix emacs-mcx. You can configure those settings. (See this page to know how to change the settings.)

After updating the settings, reload VSCode to enable the changes.

Configurable options of this extension are the followings.

emacs-mcx.strictEmacsMove

If set as true, the original emacs's cursor movements are strictly simulated. If set as false, the VSCode's native cursor movements are preserved. For example, if set as true, when you type C-a, the cursor moves to the beginning of the line (Emacs' original behavior). If set as false, on the other hand, the cursor move to the first non-empty character in the line (VSCode's native behavior of Home key).

emacs-mcx.useMetaPrefixEscape

If set as true, Escape key works as the Meta prefix like original Emacs. If set as false, Escape key works as cancel, the VSCode's native behavior. For example, if set as true, M-f (forward-word) can be issued by both alt+f and escape f.

The only exception is the commands which begin with M-g (M-g g, M-g n, M-g p). It is because VSCode can handle only up to two key strokes as the key bindings. So, as the special case, Escape g works as follows.

Command Desc
Escape g Jump to line (command palette)

emacs-mcx.useMetaPrefixCtrlLeftBracket

If set as true, ctrl+[ works as the Meta prefix like original Emacs.

emacs-mcx.useMetaPrefixMacCmd

If set as true, Command (⌘) key works as the Meta prefix like original Emacs on macOS. This option only works on macOS.

emacs-mcx.killRingMax

Configures the maximum number of kill ring entries. The default is 60.

emacs-mcx.killWholeLine

This simulates the original Emacs' kill-whole-line variable. The default is false.

emacs-mcx.cursorMoveOnFindWidget

If set to true, cursor move commands of this extension (C-f, C-b, C-p, C-n, C-a, C-e, M-f, M-b, and M-m) are disabled when the find widget is focused, to allow the widget to keep open and the cursor to move on it.

emacs-mcx.enableOverridingTypeCommand

Prefix arguments do not work on character inputs with IMEs by default and you can set this config to true in order to enable it. Note that this config makes use of VSCode API's type command under the hood and can cause problems in some cases.

emacs-mcx.debug.*

Configurations for debugging.

'when' clause context

This extension provides some contexts that you can refer to in "when" clauses of your keybindings.json.

emacs-mcx.inMarkMode

boolean

This indicates whether mark-mode is enabled.

emacs-mcx.acceptingArgument

boolean

This indicates the editor is accepting argument input following C-u.

emacs-mcx.prefixArgumentExists (experimental)

boolean

This indicates if a prefix argument exists. Use this boolean context to check the existence of a prefix argument, instead of using emacs-mcx.prefixArgument with null check.

emacs-mcx.prefixArgument (experimental)

number | undefined

This is a currently input prefix argument.

Keymaps

Alt key is mapped to the Meta prefix (M) by default and you can configure for Escape, ctrl+[, or Command (⌘) key (macOS only) to work as it with the settings above.

Move commands

Command Prefix argument Desc
C-f Move forward (forward-char)
C-b Move backward (backward-char)
C-n Move to the next line (next-line)
C-p Move to the previous line (previous-line)
C-a Move to the beginning of line (move-beginning-of-line)
C-e Move to the end of line (move-end-of-line)
M-f Move forward by one word unit (forward-word)
M-b Move backward by one word unit (backward-word)
M-m Move (forward or back) to the first non-whitespace character on the current line (back-to-indentation)
C-v Scroll down by one screen unit (scroll-up-command)
M-v Scroll up by one screen unit (scroll-down-command)
M-S-[ (M-{ with US keyboard) Move back to previous paragraph beginning (backward-paragraph)
M-S-] (M-} with US keyboard) Move forward to next paragraph end (forward-paragraph)
M-S-, (M-< with US keyboard) Move to the top of the buffer (beginning-of-buffer)
M-S-. (M-> with US keyboard) Move to the end of the buffer (end-of-buffer)
M-g g (M-g M-g) Jump to line (command palette)
M-g n (M-g M-n, C-x `) Jump to next error
M-g p (M-g M-p) Jump to previous error
C-l Center screen on current line (recenter-top-bottom)

Search Commands

Command Desc
C-s Search forward
C-r Search backward
M-S-5 (M-% with US keyboard) Replace
C-M-n Add selection to next find match
C-M-p Add selection to previous find match

Edit commands

Command Prefix argument Desc
C-d Delete right (DEL)
C-h Delete left (BACKSPACE)
M-d Kill word (kill-word)
M-Bksp Kill word left (backward-kill-word)
C-k Kill from the current cursor to the end of line (kill-line)
C-S-Bksp Kill whole line (kill-whole-line)
C-w Kill region
M-w Copy region to kill ring
C-y Yank
M-y Yank pop
C-o Open line
C-j New line
C-m New line
C-x C-o Delete blank lines around (delete-blank-lines)
C-x h Select All
C-x u, C-/, C-S-- (C-_ with US keyboard) Undo
C-; Toggle line comment in and out
M-; Toggle region comment in and out
C-x C-l (M-l) Convert to lower case (On the Emacs' original behavior, C-x C-l and M-l are assigned to the different functionalities. However, this extension assigns these keys to the same emacs-mcx.transformToLowercase command which calls editor.action.transformToLowercase command internally and works similarly to both the original Emacs' functionalities based on the context. Upper case and title case (below) are same)
C-x C-u (M-u) Convert to upper case
M-c Convert to title case
M-S-6 (M-^ with US keyboard) Merge the previous and the current line (delete-indentation)

Mark Commands

Command Desc
C-SPC, C-S-2 ([email protected] with US keyboard) Set the mark at point, and activate it (set-mark-command).
C-SPC C-SPC Set the mark, pushing it onto the mark ring, without activating it.
C-u C-SPC Move point to where the mark was, and restore the mark from the ring of former marks.
C-x C-x Set the mark at point, and activate it; then move point where the mark used to be (exchange-point-and-mark).

See this page and this page about the mark and the mark ring.

Other Commands

Command Desc
C-g (ESC) Cancel
C-' (M-/) IntelliSense Suggestion
M-x Open command palette
C-M-SPC Toggle SideBar visibility
C-x z Toggle Zen Mode

File Commands

Command Desc
C-x C-f QuickOpen a file
C-x C-s Save
C-x C-w Save as
C-x C-n Open new window

Tab / Buffer Manipulation Commands

Command Desc
C-x b Switch to another open buffer
C-x k Close current tab (buffer)
C-x C-k Close all tabs
C-x 0 Close editors in the current group.
C-x 1 Close editors in other (split) group.
C-x 2 Split editor horizontal
C-x 3 Split editor vertical
C-x 4 Toggle split layout (vertical to horizontal)
C-x o Focus other split editor

Prefix argument

Command Desc
C-u universal-argument (See https://www.gnu.org/software/emacs/manual/html_node/emacs/Arguments.html for detail)

sexp

Command Prefix argument Desc
C-M-f Move forward over a balanced expression (forward-sexp)
C-M-b Move backward over a balanced expression (backward-sexp)
C-M-k Kill balanced expression forward (kill-sexp)

This extension makes use of paredit.js to provide sexp functionalities. Thank you for this great library.

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+j: workbench.action.togglePanel => Use ctrl+x j 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.openFileFolder;

Contributions/Development

Your contributions are very welcome!

Please see DEVELOPMENT.md about development of this extension.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].