Keyboard shortcut for word wrapping in Cloud9

In Cloud9, you can enable / disable word wrap by going to View> Wrap Lines or Cog in the lower right corner. But there is no keyboard shortcut for this. The Keybindings editor also has no commands matching the word "wrap" (except for one for Emmet).

The files that my users work on have parts that are best viewed with word wrap, as well as parts that are best viewed with it, so rotating words globally is not enough.

Is there any other term I have to find to create a keyboard shortcut? Or is there no way to enable / disable the wrapper without the mouse menu +?

+4
source share
2 answers

There is no built-in command for this, but you can use the init script function in the menu Cloud9. Just add:

services.commands.addCommand({
    name: "toggleWordWrap",
    bindKey: {win: "alt-shift-w", mac: "alt-shift-w", position: 1000},
    exec: function(editor) {
        editor.setOption("wrap",  editor.getOption("wrap") == "off")
    }, 
    isAvailable: function(editor) {return editor && editor.ace}
}, plugin);

position: 1000 means that the command gets higher priority than the default commands with the same key

+3
source

As of November 2016, you can switch the “soft” word wrap using Crtl+ q.

You can also find a list of commands on the "Commands" tab on the left.

enter image description here

+1
source

All Articles