Easy Kill
Select & Copy Things Easily in VS Code - a port of easy-kill for Emacs.
Install
Features
- Drop-in replacement for standard copy (Cmd+C / Ctrl+C) - works with existing selections or triggers intelligent selection when no text is selected
- Quick copying/selecting with intelligent selection
- 30+ selection types: subword, word, line, sentence, paragraph, sexp, defun, function, block, string, parentheses, brackets, curlies (with/without delimiters), buffer, filename, URL, email, character search, and more
- Interactive expansion/shrinking of selections
- Duplicate selections quickly before or after the current selection
- Vim-friendly character search with f/t-style selection (forward/backward, to/up-to)
Usage
Commands
Selection Commands:
- Easy Kill: Copy (Ctrl+C / Cmd+C) - Copy text at point with intelligent selection. If text is already selected, performs standard copy.
- Easy Kill: Select (Alt+Shift+2) - Select text at point
Movement Commands:
- Easy Kill: Forward Subword (Alt+→ / Ctrl+Alt+→) - Move forward by subword (camelCase/snake_case aware)
- Easy Kill: Backward Subword (Alt+← / Ctrl+Alt+←) - Move backward by subword
- Easy Kill: Forward Word (Ctrl+Alt+→ / Ctrl+→) - Move forward by word
- Easy Kill: Backward Word (Ctrl+Alt+← / Ctrl+←) - Move backward by word
- Easy Kill: Forward Sentence - Move forward by sentence
- Easy Kill: Backward Sentence - Move backward by sentence
Note: Movement commands support selection when invoked with shift key.
Duplicate Commands:
- Easy Kill: Duplicate After - Insert a copy after the selection
- Easy Kill: Duplicate Before - Insert a copy before the selection
These commands duplicate the current selection, or if nothing is selected, the first matching object type from easyKill.objectTypeOrderForDuplicate (default: line). The original text remains selected, entering Select mode so you can press y repeatedly to create more copies.
Interactive Selection
After triggering a command, you can interactively adjust the selection:
- Confirm (Enter) - Confirm selection and exit
- Cancel (Escape/Ctrl+G) - Cancel and restore cursor position
- Expand (+/=) - Expand selection by 1
- Shrink (-) - Shrink selection by 1
- Cycle (Space) - Cycle through selection types
- Duplicate After (y) - Insert a copy after the selection
- Add to Count (1-9) - Add N to current count (e.g., pressing 4 when count is 1 expands to 5 instances; pressing 4 when count is -1 expands to 3 instances)
- Reset (0) - Reset to initial size (count = 1)
- Change Type (letter keys) - Switch to specific selection type (see Selection Types below)
All key bindings above (except Cancel) are customizable via the easyKill.keyBindings setting. To customize Cancel (Escape/Ctrl+G), use VS Code's Keyboard Shortcuts settings for the easyKill.cancel command.
Selection Types
Available selection types (default key bindings shown in parentheses, customizable via settings):
Text Objects:
- Subword (w) - camelCase/snake_case aware word part
- Word (W/s) - "word" (symbol in Emacs / WORD in Vim)
- Line (l) - Current line with newline
- Sentence (.) - Sentence ending with punctuation
- Paragraph (p) - Text between blank lines
Code Structures:
- Sexp (e) - S-expression or balanced expression
- Defun (d) - Enclosing function/method/class definition
- Defun Name (D) - Name of enclosing function only
- Function (f) - Alias for defun
- Block (b) - Alias for sexp
Delimited Regions:
- String (q) - String at cursor (language-aware)
- String Universal (Q) - String with any quote type
- Parentheses (() - Text including parentheses
- Parentheses Content ()) - Text inside parentheses
- Brackets ([) - Text including brackets
- Brackets Content (]) - Text inside brackets
- Curlies ({) - Text including braces
- Curlies Content (}) - Text inside braces
Buffer Regions:
- Buffer (a) - Entire buffer content
- Buffer Before (<) - From buffer start to cursor
- Buffer After (>) - From cursor to buffer end
Special:
- Filename (/) - File path at cursor
- Buffer File Name (n) - Current file's full path
- URL (u) - URL at cursor (auto-prefixes protocol)
- Email (@) - Email address at cursor
- Backward Line Edge (^) - From line start/indent to cursor
- Forward Line Edge ($) - From cursor to line end
Character Search:
- To Char Forward (f) - From cursor to character (inclusive)
- Up To Char Forward (t) - From cursor to before character
- To Char Backward (F) - From character to cursor (inclusive)
- Up To Char Backward (T) - From after character to cursor
How It Works
Copy Mode (Cmd+C / Ctrl+C)
- If text is selected, performs standard copy
- If no selection, triggers easy-kill (copy) mode:
- Extension selects text starting from smallest match (word)
- Selection is prepared first, then copied when the copy session is finalized (normally by
Enter/Return)
- The session can also be finalized by other commands that leave Easy Kill copy-mode context
- Adjust selection using quick pick menu
- Selection changes do not copy to the OS clipboard until acceptance
Select Mode (Alt+Shift+2)
- Trigger the command
- Extension selects text starting from smallest match (word)
- Adjust selection using quick pick menu
- On confirm, text is selected in editor (not copied)
Integration
Awesome Emacs Keymap (emacs-mcx)
If you use Awesome Emacs Keymap (emacs-mcx), Easy Kill integrates with its kill ring by sending only the final selection when the copy session ends. Intermediate selection changes are never pushed to the OS clipboard or emacs-mcx. Use C-y to yank the latest copy and M-y to cycle through earlier ones.
Inspiration
This extension is a port of easy-kill and easy-kill-extras for Emacs, bringing their intelligent selection and manipulation capabilities to VS Code.
License
Copyright (c) 2025-2026 Akinori Musha
MIT License - see LICENSE file for details.
Repository
https://github.com/knu/vscode-easy-kill