I am using windows and VS Code, I have few files that I do not need to wrap them wherever I press Alt+Shift+F, is there a way to disable auto format wrapping for specific files?
Asked
Active
Viewed 5,745 times
12
-
I found this other post that might help https://stackoverflow.com/questions/31025502/how-to-switch-word-wrap-on-and-off-in-vscode – Sean Mahoney Jun 02 '19 at 14:16
-
yes, I have seen these before, they are for the whole app, I need to apply it to specific file. – Ehsan Zargar Ershadi Jun 02 '19 at 14:33
-
I doubt you can turn off word wrapping for specific files - you can for all files of a language but you probably don't want that. You could turn off formatting of `specific` files by altering the keybinding for formatting but that requires you to set a regex that would match the files you want excluded. Let me know if you want to see that method. – Mark Jun 05 '19 at 04:02
-
I'm facing the same issue here. Want ONLY txt files to be warp and not a long line. If you a solution for this, it would be helpful to share it. – Or Assayag Nov 15 '20 at 14:42
3 Answers
16
Explained here Language-specific editor settings but specifically:
- CTRL+SHIFT+P and type "Preferences: Configure Language Specific Settings"
- Select the language or add section in the file (start typing [ to see list of suggestions) or edit if already there.
- If wrapping, depending on columns available in your editor you might want to update
editor.wordWrapColumn
. Lines will wrap at the minimum of viewport andeditor.wordWrapColumn
Example:
...
"editor.wordWrapColumn": 200,
"[typescript]": {
"editor.tabSize": 2,
"editor.wordWrap": "off",
},
"[plaintext]": {
"editor.wordWrap": "bounded",
},
...

Ricardo stands with Ukraine
- 4,508
- 2
- 42
- 59
-
1Thank you! I couldn't toggle it off, for some reason, even though I was changing the global setting. I didn't realize there were language-specific wrap settings. This fixed it for me. – Ixalmida Apr 23 '21 at 16:00
3
Looks like VSCode allows for this. You can tweak it as you prefer for each file type.
However note that there have been reports of it not working for markdown files. I guess it is something still being tweaked.

Renato Byrro
- 3,578
- 19
- 34

Lucat
- 2,242
- 1
- 30
- 41
0
Looks like this person made an extension that might be useful for you.
https://marketplace.visualstudio.com/items?itemName=Ho-Wan.setting-toggle
Looks like you can setup a few quick easy setting toggles. would at least make it quicker as you're bouncing from file to file.

Sean Mahoney
- 26
- 4
-
This extension toggles the setting for the whole app, I need to disable word wrapping for specific files. – Ehsan Zargar Ershadi Jun 03 '19 at 12:49