Coder Social home page Coder Social logo

ayrtonmassey / vscode-emacs-region Goto Github PK

View Code? Open in Web Editor NEW

This project forked from t-yng/vscode-emacs-region

3.0 2.0 3.0 139 KB

This is extension for Visual Studio Code to provide function of region selection like Emacs

License: MIT License

TypeScript 100.00%

vscode-emacs-region's Introduction

vscode-emacs-region

An extension for Visual Studio Code which provides region selection & operations similar to emacs.

Default Keybindings

key explanation
ctrl+f move selection cursor right
ctrl+b move selection cursor left
ctrl+p move selection cursor up
ctrl+n move selection cursor down
right move selection cursor right
left move selection cursor left
up move selection cursor up
down move selection cursor down
ctrl+right move selection cursor one word to the right
ctrl+left move selection cursor one word to the left
ctrl+v move selection cursor one page down
alt+v move selection cursor one page up
ctrl+a move selection cursor to start of line
ctrl+e move selection cursor to end of line
alt+shift+, move selection cursor to start of file
alt+shift+. move selection cursor to end of file
ctrl+y paste and stop selection
ctrl+w cut and stop selection
alt+w copy and stop selection
backspace delete selected text and exit region mode
delete delete selected text and exit region mode
ctrl+space start region mode
ctrl+x space start column region mode
ctrl+g exit region mode

Custom Commands

command explanation
emacs.action.clipboardCopyAction Copy the selected region and exit region mode.
emacs.action.clipboardCutAction Cut the selected region and exit region mode.
emacs.action.clipboardPasteAction Paste over the selected region and exit region mode.
emacs.deleteLeft Kill region and exit region mode.
emacs.deleteRight Kill region and exit region mode.
emacs.startRegionMode Start region mode with a single cursor.
emacs.startColumnRegionMode Start region mode with multi-line cursors.
emacs.exitRegionMode Exit any active region mode.

Compatibility With Other Extensions

It is possible to combine this extension with other cursor movement extensions.

You can use the inRegionMode context flag in the when clause of your keybind to provide different behaviour for region mode vs. cursor mode. The default keybinds are laid out as follows:

{
    "key": "DESIRED KEY",
    "command": "CURSOR MOVE COMMAND",
    "when": "editorTextFocus && !inRegionMode"
},
{
    "key": "DESIRED KEY",
    "command": "CURSOR MOVE & SELECT COMMAND",
    "when": "editorTextFocus && inRegionMode"
}

Contributing

If you'd like to add more features, feel free to send a pull request on GitHub.

Known Issues

  • When cutting text (emacs.action.clipboardCutAction), sometimes only the line the cursor is on is removed, but the full region is sent to the clipboard. Not sure what the cause is - perhaps this is related to vscode#2933.

Acknowledgements

Thanks to t-yng for his original extension, which can be found here: t-yng/vscode-emacs-region.

vscode-emacs-region's People

Contributors

ayrtonmassey avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.