r-stein / sublime-text-keybinding-helper

A Sublime Text package to simplify the creation and look-up of key-bindings
MIT License
5 stars 0 forks source link

[Feature request] Convert .sublime-keymap to .suricate-profile file #3

Open Kristinita opened 7 years ago

Kristinita commented 7 years ago

1. Request

It would be nice, if will be added feature — convert .sublime-keymap to .suricate-profile file.

2. Justification

Some plugin developers not added commands in command palette. For example, developers Macroptimize, ConEmu, Filefinder, SyncFileYouWant, SublimeRestart and Zeal packages.

This is not good, because

  1. Hotkeys can be used in other plugins.
  2. Captions in command palette easier to remember than hotkeys.

Often I need to create commands in my command palette or change hotkeys manually. It may takes a lot of time.

3. Desirable behavior

Ctrl+Shift+PKeyBindingsHelper: Convert Keymap To Suricate → I select package neediest in conversion → Enter → conversion will be made:

Before:

[
    {"keys": ["$keys$"], "command": "$example_command$"},
]

After:

"suricate_$example_command$": {
    "caption": "$Package Name$: $Example Command$",
    "keys": ["$keys$"],
    "call": "sublime.$example_command$",
},

Example for CopyBlock package:

Before:

[
    {"keys": ["ctrl+shift+c"], "command": "copy_block"},
    {"keys": ["ctrl+shift+x"], "command": "cut_block"}
]

After:

"suricate_copy_block": {
    "caption": "CopyBlock: Copy Block",
    "keys": ["ctrl+shift+c"],
    "call": "sublime.copy_block",
},
"suricate_cut_block": {
    "caption": "CopyBlock: Cut Block",
    "keys": ["ctrl+shift+x"],
    "call": "sublime.cut_block",
},

Thanks.

r-stein commented 7 years ago

I think such a conversion command would be better placed inside the suricate package.

Kristinita commented 7 years ago

@nsubiron, what you think about it? Thanks.