Skip to content

Conversation

@adrianord
Copy link

Adds the keybinds ctrl+j and ctrl+k to down and up respectively when the urlbar is active for making selections.

This change adds:

  • Preference for activating vim navigation for backwards compatibility
  • Patch for activating the preference
  • IDs in the locales for the preference
    • Localization is all in English, but I am happy to go back and try to translate a few if that helps, just not my strong suit.

Tested on MacOS and Ubuntu (Parallels)

Behavior we see:

  • ctrl+j and ctrl+k take precedence when the urlbar is active
  • keybinds bound to ctrl+j and ctrl+j still work while the urlbar is not active
zen-urlbar-vim-navigation-1080.mov

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Feature labels Sep 24, 2025
@mr-cheffy
Copy link
Member

Could there please be some unit tests about this to make sure future firefox versions dont break this functionality?

@adrianord
Copy link
Author

@mr-cheffy I've gone ahead and written a unit test for the vim navigation feature.

It's a little crude, so let me know if you have a better way to force multiple possible selections in the URLBar more reliably. What I've done works, but I'm afraid it might be a little brittle, so I'll leave it up to your judgement.

@adrianord adrianord force-pushed the urlbar-vim-navigation branch from 300e97c to 19e0f1a Compare September 29, 2025 02:09
@adrianord
Copy link
Author

Rebased to fix conflicts, is there anything else that needs to be done in this PR before it can get reviewed?

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 29, 2025
@adrianord
Copy link
Author

Updated the PR to remove the option from Preferences to keep it just in about:config, removed the localization since that was only used for the Preferences checkbox, and added the test for when the about:config option is turned off.

@adrianord adrianord requested a review from mr-cheffy September 30, 2025 16:26
@adrianord
Copy link
Author

Is there anything else that needs to be done to get this feature out?

@adrianord
Copy link
Author

I see that a recent zen update upgraded to firefox 143.0.4, so I'm building locally to make sure everything in this PR still works.

@adrianord
Copy link
Author

adrianord commented Oct 4, 2025

Everything works, ready for re-review

@adrianord adrianord requested a review from mr-cheffy October 4, 2025 21:26
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 5, 2025
Copy link
Member

@mr-cheffy mr-cheffy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im seeing tests are failing, did you give these a try?

image

@dosubot dosubot bot removed the lgtm This PR has been approved by a maintainer label Oct 5, 2025
@adrianord
Copy link
Author

I did a full clean of my repo and rebuild then test and I don't see the test failure. What platform are you running on so I can try to reproduce? I ran the tests today on MacOS 26.0.1 and get one failing test that is unrelated to the PR.

image

@adrianord
Copy link
Author

I was able to reproduce the test failure on Ubuntu, will let you know when it is fixed.

@KennethHoff
Copy link

KennethHoff commented Oct 5, 2025

Standard vim key bindings for navigation - assuming j and k (Without modifiers) is unavailable - is ctrl-n and ctrl-p (I assume they stand for next and previous respectively, but not sure about that). ctrl-j and ctrl-k is unorthodox.

@adrianord
Copy link
Author

@KennethHoff Huh, I hadn't realized this because I'm so used to using ctrl+j and ctrl+k from my own configuration for so many years. Regardless, I feel like there is a quite a few people who are looking for this either because they use this in their own (neo)vim configuration or because they are coming from Arc where this is standard.

I'll re-think the feature, maybe just give the preference a different name, or dive deeper to make this more configurable.

@yatinlala
Copy link

#10753 has added CTRL-n and CTRL-p by default, though its not customizable. Perhaps this PR should be closed.

@adrianord
Copy link
Author

Will open another PR once I get around to working on making those keys customizable

@adrianord adrianord closed this Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants