Adding Word Wrap Toggle Shortcut Key in Sublime Text 3

Alistair MacDonald
2 min readFeb 1, 2018

--

It becomes useful to toggle Word Wrap on and off when using multiple split panes during development. For example: you may want to multi-line edit the content at the start of 10 lines; this is impossible if your content is wrapped. Yet it becomes frustrating to read text copy when it flows over the right edge of the screen, forcing you to scroll around.

While reaching for Sublime Text > Tools > View > Word Wrap is simple, it can break your flow. Here is a quick tip for setting up a shortcut key toggle in SublimeText3 to keep you flowing.

Goto Sublime Text > Preferences > Key Bindings:

Sublime Text should open the file:Default (OSX).sublime-keymap — User:

Sublime Text should place your cursor into the file automatically.

Within the square brackets [], add the following JSON snippet:

{
"keys": ["super+shift+w"],
"command": "toggle_setting",
"args": {
"setting": "word_wrap"
}
}
  • Press Command + S to save.
  • Press Command + N to start a new document.

Enter a line of text that gets wrapped.

Wrapping is ON by default in new documents.

Press Command + Shift + W:

Wrapping is now OFF. The long line overflows the screen edge.

Wrapping should now be switched off.

Done.

--

--