You can find more details about the extension and implementation at http://www.jamessturtevant.com/posts/Softwrap-a-Visual-Studio-Code-Extension/. Also see Important Notes below.
Soft wrap in VS Code
To enable Soft wrap in VS Code you have to open your user settings file (open command pallet, type 'settings', select 'Open User Settings') and add the following line:
Manually opening the User Setting file and editing the editor.wrappingColumn value was going to get old quickly. So I did what any programmer would do... automate the process.
The result is Softwrap, an extension for VS Code, that enable you to quickly switch back and for between a "soft wrap" and your more friendly code wrap. Using Softwrap is simple:
That is it! Softwrap will toggle on/off and preserve the value it was previously set to even if you had a custom value for
You can find it at the Visual Studio Market Place:
Reading and Writing the User Settings File
The limitation I ran into when trying to write to the User Settings file was that there is no VS Code API for it (see github issue). Again, I got a quick response on twitter that this was something that is under consideration but not yet implemented. The suggestion was to directly modify the file itself as a work around.
This was fairly simple to do because VS Code is sitting on top of Electron and we can leverage all the power and infrastructure of Node.js and the strong ecosystem that comes with it. It was easy enough to use the File System module to read/write the User Settings file.
VSCode JSON Schema
VS Code uses a custom JSON schema that allows comments in the settings file. My current implementation does not support comments and will strip them out. This is probably not the best way to handle the situation but will have to do for now.