Shortcut for changing tabs-> spaces-> tabs in Intellij Idea

I know that I can change the indent:

File > Settings > Editor > Code Style > ANY_LANGUAGE > Tabs and Indents > Use tab character

but in my legacy project there are mixed indents in different files. Is there a keyboard shortcut in the IDE to change spaces on tabs and vice versa? Or how can I configure one for all or specified language files?

+13
source share
4 answers

To switch between tabs and spaces:

, . .

, Ctrl + Shift + A convert indents :

enter image description here

, → → → Java, , :

enter image description here

+30

> >

"" , , , , .

: Pro Intellij, .

+1

, :

  • Cmd+Shift+R MacO, .
  • [\t]

" " , .

enter image description here

: , , , @DimaSan

0
source

You can reformat each file to apply your style in Code> Reformat Code. On Windows, the associated shortcut is Ctrl-Alt-L.

Choosing a package will give you the opportunity to reformat all the source files, including subdirectories, optionally filtered by file extension.

This is as of IntelliJ IDEA 2018.2.3 for Java files.

-1
source

Source: https://habr.com/ru/post/1666129/


All Articles