Sublime Forum

Confused about .sublime-keymap files

#1

I’m trying to publish a plugin. In the course of which, I’m trying to factor out the relevant keyboard shortcuts from ‘Default (OSX).sublime-keymap’ into a .sublime-keymap file of its own.

When I create a separate .sublime-keymap file in Packages/User, however, it seems that the .sublime-keymap file is ignored.

So for now my question is: where does a .sublime-keymap file have to be placed in order to be recognized by ST? Do I need to restart ST in order for the .sublime-keymap to be recognized?

Thanks.

0 Likes

#2

You need to name it Default.sublime-keymap if it is valid for all OSs or Default (OSX).sublime-keymap, Default (Linux).sublime-keymap or Default (Windows).sublime-keymap for OS specific mappings.

0 Likes

#3

Isn’t there an issue where OS-specific keymaps in the User package are ignored? Or was this fixed (or I’m just wrong )?

0 Likes

#4

Works for me on Windows.

0 Likes

#5

OS specific keymaps are allowed in the User package (that’s what the default Preferences > Key Bindings opens in the right hand pane). I think what you’re thinking of here is that Preferences (OSX).sublime-settings and such are not allowed in the User package.

1 Like

#6

OK. Since I already have ‘Default (OSX).sublime-keymap’ as a file in Packages/User I had to create a separate directory, which I did at the same level as ‘User’. Anyway, it seems to have worked. :+1:

Apart from that, I’m realizing that really I would like to “donate” my plugin(s) for someone else to publish. I don’t like dealing with github, etc. Please let me know if anyone is interested.

1 Like

#7

In fact there is no user sublime.keymap ? and my Default (Windows).sublime.keymap is in sublime REPL directory ! the only solution is it to modify Default (Windows).sublime.keymap ?

0 Likes

#8

To create custom key bindings run Preferences: Key Bindings from Command Palette. Saving changes of the right pane creates a sublime-keymap file in User package.

0 Likes