microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.88k stars 28.75k forks source link

Choose default wrapping per file extension #172682

Closed BawdyInkSlinger closed 1 year ago

BawdyInkSlinger commented 1 year ago

This is one of many feature requests for a single use case: I am developing a textbased game. Roughly half the time, I'm developing TypeScript in a .ts file, and I want word wrap off by default. The other half of the time, I'm writing prose in a .twee file, and I want word wrap on by default. Defaulting word wrap to on provides no more convenience than defaulting to off. Currently, I manually turn on word wrap per tab. This is nice so long so I don't restart the editor and I don't close the tab. But I don't work in the same files every day so this functionality only helps me so much. This is similar to #103199 but a different solution to the problem:

Perhaps the word wrap default could be set per extension. For example, I could see people wanting .txt, .html, .doc, .tex files to wrap by default, but their code to default to word wrap off.

ArturoDent commented 1 year ago

A language-specific setting should work for you:

  "[typescript]": {
    "editor.wordWrap": "off",
  },

  "[twee]": {                // whatever your twee language ID is, put in the brackets
    "editor.wordWrap": "wordWrapColumn",
    "editor.wordWrapColumn": 30
  },
BawdyInkSlinger commented 1 year ago

@ArturoDent Thank you. I didn't know this could already be done.