Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code - WordWrap only specific file formats

Is there a way to make Visual Studio Code Word-Wrap only specific files (.py, .cpp, etc) and not utilities formats such as .txt, .json, etc?

I just started working on a project and I need to process a lot of txt files and it's annoying not seeing how the content of the file is structured because of the Wordwrap setting.


1 Answers

Yes, this can be done by customizing your settings.json. The quickest way is to use the command palette (CTRL or CMD)+P and begin typing configure language

command palette

followed by the file type you are specifically looking to alter

enter image description here

you can then customize the settings as needed. The code below can be added to your settings.json file to make JSON and .txt files always use word wrapping by default

{
    ...
    "[plaintext]": {
      "editor.wordWrap": "on"
    },
    "[json]": {
      "editor.wordWrap": "on"
    }
}

more information can be found in the official docs

like image 60
Felipe Avatar answered Feb 24 '26 14:02

Felipe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!