Ghopper21
Ghopper21

Reputation: 10477

Trouble mapping Cmd-Delete key in Sublime Text 2

I'm trying to map Cmd-Delete (on my Mac) to delete the current line in Sublime Text 2. I added the following line in my ST2 key bindings file:

    { "keys": ["super+delete"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },

It doesn't work, i.e. Cmd-Delete retains the default "delete to beginning of line" binding. All my other key bindings, both those listed before and after the above line in the bindings file, work.

What am I doing wrong?

Upvotes: 2

Views: 392

Answers (2)

Dan P.
Dan P.

Reputation: 1431

Change the "keys" value from ["super+delete"] to ["super+backspace"].

Upvotes: 2

Tim
Tim

Reputation: 413

It should work if you put your custom bindings at the end of the list of key bindings (don’t forget to fix the trailing comma!). Otherwise any later bindings which set "super+delete" will overwrite (i.e. reset to default) super+delete.

Upvotes: 0

Related Questions