Paste and Indent for Visual Studio Code
This extension adds limited support for pasting and indenting code. Much like SublimeText's
Via Quick Open:
Via the Extensions tab:
Via the command line:
This extension provides one command:
which does all the work. Your job is to bind it to whatever key combination you like
(note however that this command is not available via the Command Pallette
An example is (change default paste with paste and indent):
Note: Reverted to the built-in command
This plugin has limitations regarding the extent at which correct indentation can be performed.
Problems arise when one tries to paste code with it's first line not on the same indentation level with the last.
Fortunatelly this is not a usual case but if you find it doesn't work as you have expected then try
enabling the setting:
What it does is that after trying to indent properly it selects the text with
probably incorrect indentation so that you can easily hit
In order to enable it you have to open your User Settings (hit
For any bugs and feature requests please open an issue. For code contributions please create a pull request. Enjoy!
Copyright (c) rubymaniac
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.