S
S
Sector5672020-03-05 17:03:36
htaccess
Sector567, 2020-03-05 17:03:36

How to customize formatting in visual studio code editor?

Two questions regarding code formatting
1) What is the difference between indenting "indent using spaces" and "indent using tabs"
I thought that "indent using spaces" sets the indentation of a space, such as a space was pressed and the specified number of characters was indented, and accordingly in in the case of "indent using tabs" - indents the specified number of characters when pressing Tab.
But in fact, it does not matter, for example, specify the value 4 for "indent using spaces" or "indent using tabs", this indent of 4 characters will be only by pressing Tab, why then "indent using spaces" ?
5e61062d2a7d0492773767.png
5e61063527355780427377.png
5e61063d9e7d2827479682.png

2) I installed a plugin for VUE vetur, as a result, when saving, it formats the code not quite as it should, for example
it is necessary that each attribute of the tag be on different lines, but when formatting, all attributes automatically become one line.
Before formatting, as I want:
5e61066e4b2a3659669726.png
After formatting, as not necessary:
5e6106852a03e921979135.png

​​Of course, you can completely disable formatting in the vetur setting (as in the screenshot below), but then the same tab will not work. Therefore, I would not want to completely refuse formatting - only that each attribute of the tag be on a new line.
5e6106b2c5b5b818939828.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2019-07-23
@dodo512

everything works on local, but on hosting it goes into a loop

Well, on a local server, Apache probably directly accepts client requests and the condition with the %{HTTPS} check works fine.
And on the hosting, requests via http and https are accepted by some kind of reverse proxy, which transmits to Apache without encryption, so %{HTTPS} is always "off". In this case, different options like %{ENV:HTTPS}, %{HTTP:X-Forwarded-Proto} may work.
On the hoster's website, the help usually has information on how the redirect to https works for them.

D
Daniil Maslov, 2020-03-05
@s0xzwasd

Just set up Vetur formatting from their documentation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question