Sublime Forum

ST on Linux on Chromebook--key bindings question

#1

Prose writer, not programmer, here. I recently discovered the ability to run Linux–and, hence, Sublime Text–on my new Chromebook. Joy.

But I’ve hit a snag. I’m trying to replicate the same ST setup I’ve been using in an Ubuntu install on an old Thinkpad. That includes a number of key-binding changes among other tweaks. But my custom key-bindings are, as far as I can tell, being ignored in my Chromebook install, even though I’ve put them in the proper packages/user directory. Other customizations within that user directory (color scheme tweaks, etc.) are working as expected.

Is the key-binding problem likely related to the fact that Linux and ST are running inside a sandbox on the Chromebook? Or is it more likely some other user error on my part (always a safe bet)?

I don’t know where to begin looking for workarounds–if any are possible. Any pointers or ideas would be much appreciated.

0 Likes

#2

Are you sure they’re in the correct location? ST will log the location it’s using to get packages/settings at startup:

startup, version: 4114 linux x64 channel: dev
executable: /opt/sublime_text/sublime_text
application: /opt/sublime_text
working dir: /home/benjamin
packages path: /home/benjamin/.config/sublime-text-3/Packages
state path: /home/benjamin/.config/sublime-text-3/Local
0 Likes

#3

Thanks. How can I access the ST log to get that info?

In the Chromebook/Linux scheme of things, here’s where my keymap file is currently: My files/Linux files/.config/sublime-text/Packages/User/Default.sublime-keymap

0 Likes

#4

Use View > Show Console and scroll to the top of the panel.

However, you can also use Preferences > Key Bindings to open the window that allows you to edit your user bindings. In that case it’s going to open Default (Linux).sublime-keymap in the right hand pane since it always opens the one for your platform (whereas the one you mentioned defines bindings available everywhere).

0 Likes

#5

Thanks, OdatNurd. Selecting Preferences > Key Bindings reveals that I have indeed loaded the custom bindings I want, but they’re not working. For instance, the first one is:

{ "keys": ["alt+f"], "command": "toggle_side_bar" },

On my Thinkpad/Ubuntu/ST, executing this toggles the side bar, but in this Chromebook install, clicking alt+f merely inserts an f. Something seems to be getting lost between the Chromebook’s alt key and my Chromebook’s ST.

0 Likes

#6

In the console you can open with the menu item I mentioned above, enter sublime.log_input(True) and then press the key; Sublime will log what it sees that key as. That will help narrow down what’s happening.

0 Likes

#7

Great, thanks much! I’ll start the troubleshooting.

0 Likes

#8

Got it. The alt keys on the Chromebook both read as “super,” not “alt.” And the left one, if you press it alone, pops up Chromebook’s launcher. I just changed all the "alt"s in my key binding file to “super” and all is well.

I tried renaming it Default(Chromebook).sublime-keymap, just to help me keep things straight, but that broke it. But I should be able to track down why that is.

Thanks again for your help!

0 Likes

#9

For the benefit of other neophytes pursuing this subject in the future: I just discovered it’s easy as pie to change the function of the alt key on the Chromebook. It ships as “search” but in the Chromebook settings, you can just change it to “alt.” (Settings > Devices > Keyboard)

So if, like me, you have a custom sublime-keymap full of “alt”-key modifications, just change that Chromebook alt-key setting and all will be well. The “search” fuctionality will still be available from the, um, “search” key (with the little magnifying glass on it… also known as the “Everything” key).

That said, I appreciate everything I learned in this thread. Always learning.

1 Like