vscode-paste-and-indent
vscode-paste-and-indent copied to clipboard
Paste code using different spaces for indentation levels
I copied a block of code with 4-spaces per indentation level like this:
# 4 spaces indentation when copying
function code {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code"
else
local argPath="$1"
[[ $1 = /* ]] && argPath="$1" || argPath="$PWD/${1#./}"
open -a "Visual Studio Code" "$argPath"
fi
}
When I pasted it, I want it to be 2-spaces per indentation level as my settings using Spaces: 2
:
# Should be 2 spaces indentation when pasting
function code {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code"
else
local argPath="$1"
[[ $1 = /* ]] && argPath="$1" || argPath="$PWD/${1#./}"
open -a "Visual Studio Code" "$argPath"
fi
}
I tried to use this plugin, but I still did not find a way to paste it and conform the format settings.