Sublime Forum

Userkeymap not overriding default one

#1

I want alt+pageUp to switch between tabs (it does, actually, but in a weird way, not the way it switches when i use ctrl+pageUp)

So i’m changing the user keymap as you can see on the image (user keymap is on the right), but nothing happens

i just updated sublime text to version 3.0 build 3143 from an old version (where the same issue was happening)

i’m using lubuntu

0 Likes

#2

For the benefit of others that want to chime in, we’ve already gone over some basic trouble shooting steps in this SO question.

From the looks of your image, you have quite a few bindings in your user bindings if the ones in question are at line 91; do any of the other bindings work or is it ignoring all of them?

0 Likes

#3

i replaced everything in the user keymap file with just this

[
[

{ "keys": ["alt+pageup"], "command": "next_view" },
{ "keys": ["alt+pagedown"], "command": "prev_view" },

]

]

all the previous content was identical to the default keymap, except for these lines

saved, nothing changed

by the way, oddly alt+pageUp currently has this effect i mentioned, but it’s not listed on the default keymap (nor in the user keymap)

0 Likes

#4

If your post above is indicative of what your file looks like (i.e. two pairs of [ and ]), then that may be your problem. Although that’s valid JSON it’s not a valid key binding file and makes Sublime generate messages like the following to the console every time you save (at least in the build of Sublime that I’m running here):

Unable to parse binding [{command: next_view, keys: [alt+pageup]}, {command: prev_view, keys: [alt+pagedown]}]

If that’s the case, remove the extraneous [ pairs and that may help. e.g.:

[

{ "keys": ["alt+pageup"], "command": "next_view" },
{ "keys": ["alt+pagedown"], "command": "prev_view" },

]

Note that the way that Sublime works, the defaults (from the left pane) are always used, and the user contents (in the right pane) are just “addendums” that augment the defaults. So you don’t want to duplicate the defaults into your user preferences, just add your own customized bindings to it such as the two here.

0 Likes

#5

“So you don’t want to duplicate the defaults into your user preferences, just add your own customized bindings to it such as the two here.”

oh i see, changed that now, but didn’t help. however it occurred to me now that maybe “next_view” and “prev_view” might not be exactly what i’m looking for. the effects i want alt+pageUp/pageDown to have is to switch to the adjacent tab (to the right or to the left, not necessarly to the previously viewed tab)

0 Likes

#6

solved. i tried replacing next_view and prev view with alt+left and alt+right, for which i have shortcuts on my mouse (for going back and forth on the browser)

thank you

1 Like