How to indent/format a selection of code in VSCode with ctrl+shift+f

放肆的年华 提交于 2019-11-29 19:56:40

I want to indent a specific section of code in VSCode:

  • Select the lines you want to indent,
  • use Ctrl + ] to indent them.

If you want to format a section (instead of indent it):

  • Select the lines you want to format,
  • use Ctrl + K, Ctrl + F to format them.
  • you can also indent a whole section by selecting it and clicking TAB
  • and also indent backward using Shift+TAB

and of course for auto indentation and formatting, following the language your using you can see which good extension do the good job, and which formatters to install or which parameters settings to enable or set. Each language and it's available tools. Just make sure to read well the documentation of the extension, to install and set all what it need. Up to now indentation problem bother me with python when copy pasting a block of code, if that's the case here how you solve that https://stackoverflow.com/a/46899704/7668448 .

In OSx "Document Format" , Select all lines that you need format

Option + Shift + F
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!