I’ve been trying to figure out how to format URL link but just cannot find a solution. Here’s what I have currently:
and here’s what I want it to be
Except adding those tabs breaks the URL. I’m aware of the ALT + Z
word wrap for vscode, however I would like a little more control on exactly where the text wraps and that I can set different lengths for different URLs.
is this something even possible?
2
Answers
If you want to set different length for different URLs, you have to do it manually. If you want a similar length, you can update
VS Code settings
or add a tool likeprettier
and addmax-length
rules in it.You can use an extension like Prettier to handle formatting in VSCode. Install Prettier and after installing,
In the search bar, type Prettier. You will see various options like "Print Width", "Tab Width", etc.
Print Width: Controls the maximum line length. This can help you avoid very long URLs that go off-screen. Default is 80 characters, but you can increase it:
Format on Save: If you want Prettier to automatically format your files upon saving, enable the following: