Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.)

like image 810
cdyson37 Avatar asked Dec 20 '17 09:12

cdyson37


People also ask

How do I move multiple lines of code in Vscode?

Select the lines you want and then press: Windows: Shift + Alt + i. Mac: shift + option + i.


1 Answers

There was a feature request for that in 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 whtespace 🤦‍♂️.

enter image description here

like image 62
Alex Avatar answered Sep 23 '22 00:09

Alex