Question

I would like to know how I could create a key binding to say CMD + ; which will add a ; at the end of the line and then move the next line. How can I do this?

Was it helpful?

Solution

Create a macro eol_semi.sublime-macro

[
    {"command": "move_to", "args": {"to": "eol", "extend": false} },
    {"command": "insert", "args": {"characters": ";"}},
    {"command": "insert", "args": {"characters": "\n"}}
]

then add a keybinding to it in your user .sublime-keymap file

{ "keys": ["super+;"], "command": "run_macro_file", "args": {"file": "Packages/User/Snippets/test_snippets/eol_semi.sublime-macro"} }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top