StormyKnight
StormyKnight

Reputation: 607

Key Binding for Wrap Lines Doesn't Work

I've created the following Key Binding for Edit > Wrap > Wrap paragraph at 80 characters. It doesn't work. Is the syntax correct.

{ "keys": ["ctrl+w"], "command": "wrap_lines", "args": {"column": 80}}

Note that I'm not sure I have the name of the command correct. I've tried several variations. One web site said it should be 'wrapLines', but that didn't work either.

If anyone knows what I'm doing wrong, I'd be thankful for a pointer.

Upvotes: 0

Views: 46

Answers (1)

MattDMo
MattDMo

Reputation: 102852

You're very close. The actual command should be:

{ "keys": ["ctrl+w"], "command": "wrap_lines", "args": {"width": 80}}

To figure that out, I opened Sublime's console (View -> Show Console or Ctrl`) and entered

sublime.log_commands(True)

I then clicked back into a Markdown document I had open and selected Edit -> Wrap -> Wrap paragraph at 80 characters, and the following printed out in the console:

command: wrap_lines {"width": 80}

Once I had the correct command and parameters, I entered

sublime.log_commands(False)

to turn off event logging, on the off chance that I might want to check the console later for an error or whatnot.

Upvotes: 2

Related Questions