Toggle Soft Wrap : Key Binding


Is there a way to bind a set of keys to “Toggle Soft Wrap” ?


I wanted to do precisely this, but am falling at the first hurdle. I tried adding these lines to my keymap.cson file:

  'alt-cmd-\': 'editor:softWrap'

but this seems to have no effect (after restarting app, too). What is the correct way of adding this toggle to the keybinding? (I’m surprised it isn’t already assigned “out of the box”, actually!)



There are a few issues with your example:

  1. The command is editor:toggle-soft-wrap
  2. The syntax you have for the keystroke is incorrect, it should be 'alt-cmd-\\'. The single backslash escapes the single quote so the string doesn’t end until just before the e in editor.
  3. Cmd+Alt+\ conflicted with one of the default keyboard shortcuts in my installation of 1Password.

Even when I disabled that shortcut, Cmd+Alt+\ was not recognized properly … but when I changed the keymap to use Cmd+Alt+Shift+Z (a key combination that I use specifically for testing key mappings because I know I’m not going to use it for anything else), everything worked fine. I’ve filed a bug about the Cmd+Alt+\ thing … because the behavior just seems weird when I look at it using the Keybinding Resolver.

Turn on Line Wrap

Thanks so much for spelling that out. Maybe I should have guessed about double-backslash; OTOH, it would be welcome to have that noted in the documentation (and if it’s there, I missed it: I did read it! really!)

Interestingly enough cmd-alt-\\ works well for me (Ubuntu 14.04, fwiw). It’s the same combination as the TextAdept toggle, and I prefer not to proliferate these if I don’t have to.

Where would one look to know that toggle-soft-wrap is the correct form for this feature? I didn’t spot that either. (So not doing very well, then! =/)

Meanwhile, it’s good to have this example working. Thanks again!


Actually, what caught that for me was the CSON syntax highlighting :laughing:

I used Cmd+Shift+P to bring up the Command Palette and then typed soft to search for soft wrap, found the command:

Then I just reversed the standard string conversion: Editor: Toggle Soft Wrapeditor:toggle-soft-wrap


Awesome, thank you for posting this!

Took me way too long trying to figure out the necessary keymap command for a quick toggle for soft wrap. Is this helpful nugget officially documented somewhere? I looked to no avail…

I tried guessing (unsuccessfully) based on the corresponding API method, but your instructions were dead on!


The new documentation has an in-depth section on key bindings:

In particular, the last paragraph of the Commands section states:


I want the soft wrap to be on, by default. Is that possible?

  1. Launch Atom
  2. Open the Settings View using Cmd+, on OS X or Ctrl+, on other platforms
  3. Scroll down to the box marked “Soft Wrap”
  4. Put a check in it


Ah, there it is:) Your the man leedohm, thank you.