There's no menu item / keyboard shortcut / command for toggling line wrapping.
Probably not much used when writing code, but useful, for instance, if you edit a text file (like *.md) on a smaller screen than the author had ... imho it's a basic feature of any text editor and we should have it there.
You can activate this feature with help workspace or user preferences:
editor.wordWrap: "on"{
"editor.fontSize": "16px",
"editor.wordWrap": "on"
}
Yes, that works, but:
Just checked the terminology ... it seems 'word wrapping' is the correct name: https://en.wikipedia.org/wiki/Line_wrap_and_word_wrap (first paragraph). In VS Code it's 'Toggle word wrap', in Kate 'Word wrap', therefore my suggestion
After a discussion with @akosyakov: I believe such a setting is very similar to other ephemeral settings like Toggle line numbers, Toggle Ins/Overwrite and so on; as such, it should be per editor view, easily triggerable (keyboard shortcut / view menu), and indicated in the bottom status bar (maybe this is not necessary, I suggest getting inspired in some popular editors out there first). Naturally, there should be some sensible default/setting per file type / per user, but that's of secondary priority. For the starters, 'Word wrap: off' in any new editor view is something one can live with - if he can toggle it easily.
I would love to have a way to toggle this by the menu. My specific use case is editing pull-requests via the GitPod chrome extension. Typically I use GitPod for minor touchups or authoring markdown documents. Workspace Preferences isn't a good workflow for me as each github pull-request typically spawns a throwaway instance.
@ghuntley You can configure it in user preferences when it will be applied always.
Good to know. Just out of interest would you take a pull request that added this feature to the menu and a shortcut?
Yes, why not? But then it will be applied only to the current editor, right? For next editor again a value from preferences will be used.
Hmmm, one approach would be to toggle the persisted value in the user preferences. I just checked Visual Studio Code's behavior as a reference and it does _not_ persist the value upon restarting the application. I think adding the menu item would suffice and _not_ persisting the value is the route to go.
Most helpful comment
You can activate this feature with help workspace or user preferences:
editor.wordWrap: "on"For example: