Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>WordWise UndoNew to Visual Studio Code? Get it now.
WordWise Undo

WordWise Undo

HexCJo

|
2 installs
| (0) | Free
Undo pasted code one token at a time from the end.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Wordwise Undo

Undo pasted or selected code one token at a time, starting from the end of a selected block.

Features

  • Normal paste: Ctrl + V continues to use VS Code's default paste.
  • Arm Wordwise Undo: Ctrl + Alt + P activates Wordwise Undo for the selected text.
  • Undo one token: Ctrl + Z removes the last token from the selected block.
  • Outside text protection: text outside the selected block is not intentionally modified by token deletion.
  • Automatic session cleanup: editing the document after activating a session ends the session to prevent stale text offsets from being used.

Keybindings

Shortcut Action
Ctrl + Alt + P / Cmd + Option + P Activate Wordwise Undo (whole file or selected block)
Ctrl + Z / Cmd + Z Undo token from the end
Ctrl + Y / Ctrl + Shift + Z (Mac: Cmd + Shift + Z) Redo last undone token
Escape Stop / cancel Wordwise Undo session

Usage

  1. Paste code normally using Ctrl + V.
  2. Edit or format the pasted code as needed.
  3. Select the complete block you want to remove incrementally.
  4. Press Ctrl + Alt + P to activate Wordwise Undo.
  5. Press Ctrl + Z repeatedly to remove tokens from the end of the selected block.

Select the intended block carefully before activating the session.

Tokenization

Words, identifiers, numbers, and punctuation are treated as tokens. Whitespace is preserved while earlier tokens are removed. The final undo operation removes the remaining selected block, including its remaining whitespace.

Limitations

  • This extension operates on a selected block; it does not automatically identify the original paste range.
  • Changes made manually after activating a session cancel that session.
  • The final token removal deletes the remaining block rather than restoring text that was previously overwritten.
  • Rich-text clipboard formatting is not handled by this extension.

Development

Requirements: Node.js, npm, and Visual Studio Code.

Compile and check the extension:

npm install
npm run compile

Run the extension in a development host by opening this project in VS Code and pressing F5.

Packaging

Create a VSIX package:

npx @vscode/vsce package

Install the generated VSIX locally:

code --install-extension ./wordwise-undo-0.0.1.vsix

Replace the example filename above with the actual generated filename if the version changes.

License

Choose and add a license before publishing this extension publicly.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft