Sublime Forum

Key binding on portable version

#1

Hello, I am using ST 3.2.2 build 3211 x64 as a portable version on windows 10.
I was testing a personal key binding, but when I click on “Key bindings” I am presented with a completely empty new file on the right panel. Nevertheless I created a new “Default (Windows).sublime-keymap” and saved it under Data->Packages->User with this content

[{ 	"keys": ["ctrl+alt+'"], "command": "insert", "args": {"characters": "`"}}, 
{ "keys": ["ctrl+alt+ì"], "command": "insert", "args": {"characters": "~"} }]

Unfortunately it does not seem to woork at all, and each time a reload the Key Bindings I am presented with the empty file and not my saved one.
Can someone point me to the right way for saving it?
Best regards
Lila

0 Likes

#2

Do you want your bindings to be platform specific? Or are using Windows only? When you click Preferences->Key bindings and see the empty file on the right, just paste your custom bindings there and save it. P.S. Your second binding in example may not work also because you have ì which is different from i (or is that on purpose?)

0 Likes

#3

Thank you for the answer! I don’t need it to be OS specific, but my portable version is on Windows and it’s existing key bindings had this name. I did exactly how you described, pasted the code and saved it as Default.sublime-keymap but since it was not working I tried renaming with Windows and moved around the folders. Also, I was expecting to find it in the side panel next time I would click on Preferences->key bindings.
As for the ì, yes it is intended! I have an Italian keyboard without back tick and tilde and it is a bit annoying, which is why I was hoping to add the bindings :wink:

0 Likes

#4

When you run a portable version, all of your configuration information should be stored inside of the Data directory inside of the portable install location. Is there anything that might be modifying that on you or blocking access? Do preferences changes also revert or only key bindings?

0 Likes

#5

Do I understand it correctly that after you save your key bindings in Data->Packages->User->Default (Windows).sublime-keymap and later open this very file again, it is empty? And the same is true for Data->Packages->User->Default.sublime-keymap? If yes, then something (some plugin?) definitely overwrites your files.

0 Likes

#6

My Dafault.sublime-keymap is stored under Data->Packages->User but seem inefective and is not listed under the plugins loaded in console. I will try some differente binding in order to see if there is something preventing this from working. Is there a log where I can check any message? Console is not saying anything meaningful.

0 Likes

#7

Yes, every time I open it is is completely empty (not even the square brackets as per guide), but the file exists in the folder.

0 Likes

#8

That’s expected; key map files aren’t plugins. :wink:

This video covers ways that you can diagnose where your key bindings are going wrong, which includes turning on logging to see what keys you’re pressing and what commands you’re running.

That said, if every time you choose Preferences > Key Bindings the file in the right hand pane is empty, then your problems are more deeply rooted than whether or not Sublime is seeing the input that you’re giving it because something is physically removing the file on you.

0 Likes