How to shift a bloc...
 
Share:
Notifications
Clear all

How to shift a block of code left/right by one space in VSCode?


myTechMint
(@mytechmint)
Member Moderator
Joined: 4 years ago
Posts: 52
Topic starter  

In VSCode, I can use alt-up and alt-down to move a line or block up or down, but I can't find a command to increase or decrease indent by one space.

I can indent/outdent by multiples of tabSize, but that's not quite general enough for me, and I don't really want to set tabSize=1.

(In Vim I made handy shortcuts to move a line or lines up/down/left/right with ctrl-k/j/h/l - it was probably the most useful bit of Vimscript I ever wrote.)


Quote
Topic Tags
myTechMint
(@mytechmint)
Member Moderator
Joined: 4 years ago
Posts: 52
Topic starter  

There was a feature request for that in the VSCode repo. But it was marked as extension-candidate and closed. So, here is the extension: Indent One space

Unlike the answer below that tells you to use

Ctrl+[

this extension indents code by ONE whitespace.

For More Visual Studio Code Shortcuts Please Refer: Visual Studio Code Shortcuts to Improve Your Productivity

This post was modified 3 years ago 3 times by Govind

ReplyQuote