SublimeText / NaturalDocs

NaturalDocs package for SublimeText 2
NaturalDocs
21 stars 3 forks source link

Super+n overrides sublime text's "new file" #2

Closed tfeldmann closed 12 years ago

tfeldmann commented 12 years ago

Please give a possibility in the config to change this behaviour.

njlg commented 12 years ago

You can override the key mappings by making entries in your Default keymap file. Click Preferences >> Key Bindings - User. Then paste:

    { "keys": ["super+n"], "command": "natural_docs_insert_block" },
    { "keys": ["super+d"], "command": "natural_docs_decorate" },
    { "keys": ["super+g"], "command": "natural_docs_group" }

And change the keys to anything you want. You, also, might need to remap super+n back to whatever it was before. E.g.

    { "keys": ["super+n"], "command": "new_window" },

By the way, what version of Sublime Text 2 do you have? I have build 2181 and super+n is not mapped to anything by default. However, OSX has a super+shift+n mapped to new_window.

tfeldmann commented 12 years ago

I'm on build 2181 as well and as soon as I disable NaturalDocs the default binding is visible again. Screenshot

I already remapped the keys - I just wanted to suggest to use less important key binding by default. Thank you nonetheless!

njlg commented 12 years ago

I guess I am totally blind. I see it in the Default (OSX).sublime-keymap file now. What do you think about these being the default key mappings on OSX?

    { "keys": ["ctrl+n"], "command": "natural_docs_insert_block" },
    { "keys": ["ctrl+d"], "command": "natural_docs_decorate" },
    { "keys": ["ctrl+g"], "command": "natural_docs_group" },
tfeldmann commented 12 years ago

It's better, but:

ctrl+n overrides move down one line (that's okay)
ctrl+d overrides right delete (okay, too)
ctrl+g overrides Goto Line (mh...)

I think the best thing you can do is disabling them altogether and putting the commands into the command palette. I never actually used the key mappings because I like the context sensitivity much more. It feels more natural :)

njlg commented 12 years ago

I agree that context sensitive key mappings are awesome, but sometimes it is nice to have a shortcut too. I think I will just make the key maps obscure for OSX. And then people can just disable them if they don't like them, but at least now they are not overriding anything. Here is what I think I will use:

    { "keys": ["super+n", "super+n"], "command": "natural_docs_insert_block" },
    { "keys": ["super+n", "super+d"], "command": "natural_docs_decorate" },
    { "keys": ["super+n", "super+g"], "command": "natural_docs_group" }

Also, note that both "NaturalDocs: Insert Block" and "NaturalDocs: Decorate Line" are in the command palette.

abnovak commented 11 years ago

This is still an Issue in OS X. The Default.sublime-keymap file is still being used for keymapping, rather than the Default (OSX).sublime-keymap file.

Editing the Default.sublime-keymap file by changing the three commands to "super+alt+n", "super+alt+d", and "super+alt+g" will fix this issue.

Editing the Default (OSX).sublime-keymap file does nothing currently on os x.

njlg commented 11 years ago

Are you using ST3? I just made that change to the ST2 version. I think I need to unify the ST2 and ST3 versions.

abnovak commented 11 years ago

Nope, I'm using ST2.

njlg commented 11 years ago

Sorry to mess up your keymaps. Let me know how it works after an update.