Vim-like keyboard interface
-
Also it would be nice to be able to go in "source-edit" mode and back via keyboard
sou you can edit source in place and render it without sending another server request, for web development that would be fast and very useful. -
+1 for vim keybindings (but please make them user configurable!)
-
Really need it. It will be a killer feature (at least for me).
Other Chromium-based browser have Vimium and other similar extensions, but... let's compare it to, for example, VimFx for Firefox.- Vimium is not able to work on protected pages like browser settings pages, chrome-extension, chrome webstore, view-source and other. VimFx works everywhere.
- Vimium is not able to focus on omnibar, and implements its custom (not ideal, has limitations) address box. VimFx just uses native browser address bar, and everything works fine. So when using Vimium i have to use either limited custom address bar or inconvenient native one.
- Vimium is not able to manage browser UI elements while VimFx allows to click browser elements (tabs, extension icons, even browser window close-minimize-expand buttons). It is because Firefox UI is based on XUL -- a markup language. Vivaldi UI is based on HTML -- a markup language too. You have all the possibilities to implement this behavior.
So Vivaldi has a chance to really become "a hacker browser" instead of laggy Firefox and i-know-better-what-you-want Chrome.
-
This one is worth checking out - a while since I've used it (no more FFox for me) but in those days I compared all similar addons and Vimperator was the absolute top:
https://addons.mozilla.org/en-US/firefox/addon/vimperator/ -
Perhaps the easiest for developers to start with would be adding the keyboard shortcut commands "Navigation Up", "Navigation Down", "Navigation Left", and "Navigation Right", which scroll the page from the keyboard (like the arrow keys).
If you want vimium bindings, a lot of the commands are already built into Vivaldi and available for mappping. In the vimium options I've unmapped all of these and set their default command using Vivaldi instead (so it even works on PDF tabs and other protected pages). The only major ones missing for me are
h
j
k
l
for scrolling,f
for link navigation, and a way to dog
g
(pressg
twice) to scroll page to top.#Vimium mappings replaced by native Vivaldi mappings: #open new tab unmap t #go back/forward in history unmap H unmap L #go one tab left/right unmap J unmap K #close tab, restore tab unmap x unmap X #refresh page, pin tab unmap r unmap <a-p> #scroll page to bottom unmap G #find, next/previous results unmap / unmap n unmap N #insert mode (disable/enable keyboard shortcuts) unmap i #paste and go unmap p #Vivaldi has shortcut section for these commands, but doesn't support two-part mnemonic shortcuts: #scroll to top/bottom of page # unmap gg map <c-]> passNextKey
-
@kuna-prime It would be neat to have a global "normal mode" triggered by the Escape key. I often find myself attempting to Escape out of an input box only to be met by more commentary/options. This makes even implementing the keybindings manually difficult because you never know when you might be inside a textbox.
-
Just noticed that Vivaldi now has
Page Up
andPage Down
keyboard shortcuts available, and this does work on protected system pages like chrome extension webstore, View page source, vivaldi://sync-internals, and others. However it still doesn't work in the tab PDF viewer, which is a little strange to me since I remapped/
to open "Find", and that does work in the PDF tab viewer.This is kinda what I was hoping for, although I was hoping for shortcuts for left/right shortcuts as well, and for shortcuts causing scrolling behavior rather than full-page-move behavior (like from arrow keys rather than PgUp/PgDn keys).
-
Also, this thread should probably be moved to the forum section Feature Requests for Desktop and get the tags
SHORTCUTS
andNAVIGATION
. Presumably mods can do that, if they so have the desire? Only realized this after I happened across the related thread Enable Custom Key Navigation for Quick Command Menu, which is a different forum section (my guess is Feature Requests for Desktop didn't exist when this feature request originally arose). -
@ukanuk Maybe we should start by making a list of changes and features needed to make an extension like Vimium superfluous. Vivaldi has more than hinted at the desire to make the browser working with keyboard alone, for the greater part because of reasons of accessibility for everyone. Sadly spatial navigation never worked well and is the wrong approach. Moreover accessing the UI could be greatly improved too.
-
@luetage At the time when the Vivaldi spatnav was broken I went looking for alternatives. I found of course Vimium and its clones, but they are too heavy and complex with a massive learning curve for me.
I found this though:
https://chrome.google.com/webstore/detail/spatial-navigation/gogippjaikoijhcdcioeajgpmlmchkbaIt's got basic navigation as well as single-key link targets (cycled). I changed the code a bit to allow for WASD and F for following links, and support for Ctrl/Shift-keys:
https://pastebin.com/igYwrvWCProblem is, the extension is dead and might stop working at any time, last updated in 2015. It seriously needs a new developer.
If Vivaldi could implement something similar it would certainly do it for me. Obviously they'd allow us to change the keys so the masochists who prefer HJKL would also be satisfied
-
@Pathduck That’s 2 pair of shoes. While spatial navigation selects elements, the vim like extensions all scroll, which is far more natural and works independently from page layout. That’s also why I think spatial navigation is the wrong approach. I tested the extension you linked and it certainly works better than Vivaldi’s feature, that doesn’t change my opinion about the matter though. It’s both more invasive and unreliable (and slower too).
-
@luetage said in Vim-like keyboard interface:
@ukanuk Maybe we should start by making a list of changes and features needed to make an extension like Vimium superfluous. Vivaldi has more than hinted at the desire to make the browser working with keyboard alone, for the greater part because of reasons of accessibility for everyone. Sadly spatial navigation never worked well and is the wrong approach. Moreover accessing the UI could be greatly improved too.
I am glad that spatial navigation is back, I have always used it in combination with Vimium, of course it is not the perfect solution, but I doubt that out there we have a solution which would make everyone happy. On the Vivaldi desktop side one thing I am missing is the possibility to access synced tabs via keyboard (and it should work like the Firefox synced tab button which syncs your devices every time you hit it).
Probably a list is a good idea -
@Pathduck said in Vim-like keyboard interface:
I changed the code a bit to allow for WASD and F for following links, and support for Ctrl/Shift-keys:
You're concerned about the learning curve of Vimium and I can totally understand that. That's why I wish all these keyboard shortcuts were available to map in Vivaldi's interface.
For now, I would still recommend you switch to Vimium as it allows you to disable all hotkeys and then add in only the ones you care about. After installation, go to vivaldi://extensions → Vimium → Details → Extension Options, and then add this text in Custom key mappings for just plain WASD navigation with f/F for following links in current/new tab.
unmapAll map w scrollUp map a scrollLeft map s scrollDown map d scrollRight map f LinkHints.activateMode map F LinkHints.activateModeToOpenInNewTab
Further documentation is at https://github.com/philc/vimium/blob/master/README.md
-
@luetage said in Vim-like keyboard interface:
@ukanuk Maybe we should start by making a list of changes and features needed to make an extension like Vimium superfluous.
I already said this in paragraph form, but you're right a list is probably clearer. Here are the keyboard shortcuts and features for which I use Vimium, which cannot currently be added in vanilla Vivaldi and as an extension cannot work on protected pages like PDFs, browser settings pages, chrome-extension, chrome webstore, view-source, and so on:
Keyboard shortcuts:
- Scrolling
h
scroll left (just like left-arrow)j
scroll down (just like down-arrow)k
scroll up (just like up-arrow)l
scroll right (just like right-arrow)- Navigating Quick Commands results should also be possible with
jk
rather than arrow keys, see existing feature request Enable Custom Key Navigation for Quick Command Menu
y
to copy selection to clipboardP
to Paste and Go in a New Tab, see existing feature request Shortcut to Paste and Go in a New Tabgg
(pressg
two times in a row) scroll page to top.- Vivaldi allows shortcuts for this command, but does not support mnemonic shortcuts aka shortcuts with modifier keys. See existing feature request Mnemonic Shortcuts
gs
(pressg
ands
one after the other, not simultaneously) view page source.- Vivaldi allows shortcuts for this command, but does not support mnemonic shortcuts aka shortcuts with modifier keys as noted above.
yy
(pressy
two times in a row) copy current URL to the clipboard.- This needs the mnemonic shortcuts feature request as previously noted, and probably also feature request Concatenate Commands as this could be accomplished by sequentially commanding the existing shortcuts Focus Address Field then Copy then Focus Page.
Ctrl
+]
to execute a new command named One-Time Disable Keyboard Shortcuts or maybe more simply Ignore Next Keyboard Shortcut. This would be available right next to the existing Disable Keyboard Shortcuts command, and is useful for pages which might have predefined single-key shortcuts which might interfere with a Vivaldi single-key shortcut. For example YouTube programsf
to enter fullscreen.
General Features (self-explanatory):
n
/N
to command Find Next in Page or Find Previous in Page without needingEsc
, see existing feature request Find Next/Previous Without Showing Toolbar- Option to scroll continuously until key-up event when pressing and holding arrow/
hjkl
. Currently, pressing and holding the key triggers a small scroll, then there's a small delay until the key‐repeat event comes from the operating system for the scrolling to continue. - Site-specific settings for keyboard shortcuts, either to use only Vivaldi's hotkeys and disable hotkeys from that site, or instead to use only site's hotkeys and disable Vivaldi's keyboard shortcuts (on that site only). See existing feature requests option to disable keyboard shortcut per webpage and also Ctrl+Tab doesn't work.
- Custom scroll step size (used by
hjkl
and arrow keys). Vimium allows setting scroll step to any number of pixels. See these existing feature requests which desire setting scroll steps to any number of lines. Maybe both methods could be supported if the Vivaldi setting included units? So that would be60px
for an absolute scroll step, or2em
for a number-of-lines style scroll step. - Quick Commands / Address field keywords to search just history, or just bookmarks, etc., see existing feature requests More "internal" search engines and also Nicknamed search engines for Vivaldi features (browser history, open tabs, etc)
Advanced Features (generally requires some training, e.g. familiarity with vim and/or vimium):
f
for direct link targets in current tab (instead of spatial navigation)F
for direct link targets in new tab (instead of spatial navigation)- Keyboard-only method of selecting page text, see https://github.com/philc/vimium/wiki/Visual-Mode
- Keyboard navigation for UI, e.g. do scrolling/editing/deleting in bookmarks pane/tab, creating/editing notes, navigating within Web Panels, using the extension buttons to the right of the address bar, managing settings, etc.
gi
(pressg
andi
one after the other, not simultaneously) to Focus the first text input on the page. Useful for pages like youtube.com which do not automatically focus an input fields when first loading. Obviously other combinations of keyboard shortcuts can be used, but a dedicated keyboard shortcut is faster.- Local marks / bookmarks, allowing one to quickly save scroll position and jump between parts of a long webpage/PDF. It’s basically a more useful tabscroll.
- Scrolling
-
Here's a list of all of Vimium's available commands in v1.66, with a keyboard shortcut for the ones I actually have mapped. Note some commands Vimium supports are not currently mapped to any shortcut, like
scrollToBottom
which I've unmapped because I can already put it in Vivaldi instead. -
@ukanuk Ok, that’s perfect, I think you just volunteered to keep an updated list ^^
Some additions:
-
While arrow keys already work for scrolling, they only start scrolling after a delay, which is unacceptable for day to day use. I think setting the scroll by pixel is fine—Vimium’s scroll works well enough, therefore I think it shouldn’t matter much, if it’s pixel or lines, it just needs to be smooth.
-
The vomnibar can be fully substituted by Vivaldi’s own excellent quick commands, but it could need some improvement. We should be able to navigate results with non‐arrow keys. We should have the ability to restrict the search to bookmarks, history, commands, notes and tabs (hope I didn’t forget something). We can already search different search engines with a preceding nickname, it would be really neat, if we had the ability to set additional nicknames for all the possibilities listed.
-
Setting one key shortcuts in Vivaldi makes the Vimium search unusable, since the shortcuts will trigger when you type. Using Vivaldi’s search instead is the goal anyway. Currently the problem is that a given search can’t be confirmed by pressing <enter>. This means shortcuts to navigate the results that don’t use a modifier key will make you continue to type in the search field, instead of jumping from result to result.
-
Visual/Caret mode is missing for selecting text. Shortcuts for copying and pasting text can’t be set in Vivaldi. I believe it just uses operating system defaults.
-
Insert mode for ignoring commands.
-
Setting local/global marks isn’t implemented. Would be a nice extra.
-
Shortcut for focusing the first visible text input.
-
Shortcut for passing next key directly to page.
-
Exception list.
-
Some way to disable all shortcuts a site might have set individually? Currently not even possible with Vimium.
That’s all I can currently come up with concerning the handling of websites, we would need bigger changes yet to navigate the UI in a vim like way.
-
-
That’s the only commands I’m currently using, everything else is handled by Vivaldi (more or less).
-
@luetage said in Vim-like keyboard interface:
- While arrow keys already work for scrolling, they only start scrolling after a delay, which is unacceptable for day to day use.
I have no scroll delay when using either Vivaldi's arrow keys or Vimiums
j
k
. In any case that sounds like a bug report, not a feature request.- The vomnibar can be fully substituted by Vivaldi’s own excellent quick commands, but it could need some improvement. We should be able to navigate results with non‐arrow keys. We should have the ability to restrict the search to bookmarks, history, commands, notes and tabs (hope I didn’t forget something). We can already search different search engines with a preceding nickname, it would be really neat, if we had the ability to set additional nicknames for all the possibilities listed.
See three existing requests Enable Custom Key Navigation for Quick Command Menu, More "internal" search engines, and Nicknamed search engines for Vivaldi features (browser history, open tabs, etc). Adding to my list above...
- Setting one key shortcuts in Vivaldi makes the Vimium search unusable, since the shortcuts will trigger when you type. Using Vivaldi’s search instead is the goal anyway. Currently the problem is that a given search can’t be confirmed by pressing <enter>. This means shortcuts to navigate the results that don’t use a modifier key will make you continue to type in the search field, instead of jumping from result to result.
You can already confirm a result with
Esc
and use single-key shortcuts for Find Next in Page and Find Previous in Page. Only annoying part is that this causes the Search box to reappear, needing anEsc
to closing it again. A setting for this behavior is already requested in Find Next/Previous Without Showing Toolbar.- Shortcuts for copying and pasting text can’t be set in Vivaldi.
Vivaldi already has a Paste and Go keyboard shortcut which you can map to
p
. Adding copy and paste-and-go-in-new-tab shortcuts to my list above...- Insert mode for ignoring commands.
There is already a keyboard shortcut for disabling keyboard shortcuts. It's actually a toggle, so it will re-enable keyboard shortcuts as well. Vimium does enable/disable with
i
/Esc
, whereas Vivaldi usesi
/i
. You could request separate keyboard shortcuts for enabling, disabling, and toggling keyboard shortcuts. But to mapEsc
to re-enable keyboard shortcuts in addition to stopping page loading, the previously-mentioned Concatenate Commands feature request needs implementing.
- Setting local/global marks isn’t implemented. Would be a nice extra.
For global marks, just enable the Vivaldi setting Open on Nickname Match, create a bookmark with a nickname, then type the nickname into Quick Commands. For local marks, maybe a feature request for bookmarks that save current page position would work? I don't use them, so not sure what you want out of them.
- Shortcut for focusing the first visible text input.
Isn't this only useful with an option to prevent pages from focusing an input on load (e.g. Google, Bing, etc.)? In Vimium this option is named Don't let pages steal the focus on load.
- Shortcut for passing next key directly to page.
Can you explain an example use-case? I don't use this in Vimium and have no idea what it would look like in a generalized browser implementation.
- Exception list.
- Some way to disable all shortcuts a site might have set individually? Currently not even possible with Vimium.
See feature requests option to disable keyboard shortcut per webpage and Ctrl+Tab doesn't work. Adding to my list above...
- Visual/Caret mode is missing for selecting text.
It would be useful, but is a big feature requiring a ton of additional keystrokes and patterns, documented at https://github.com/philc/vimium/wiki/Visual-Mode. I'm not sure Vivaldi devs could effectively maintain code for this unless someone on their team actively uses it. Thus I'm adding it to my list above, but noting it's low priority.
That’s all I can currently come up with concerning the handling of websites, we would need bigger changes yet to navigate the UI in a vim like way.
What UI navigation would you want that doesn't come via Quick Commands or a keyboard shortcut? Vim has no UI to navigate, and ideally Vivaldi doesn't need a UI to navigate either.
-
Hmm.
The delay on scrolling with arrow keys isn’t a bug, it comes from the delay in key‐repeat settings directly from the operating system. Maybe you have no delay set. The difference to the Vimium implementation is that Vivaldi executes a scroll on first keydown event and then waits for another input, which will only happen after the set delay. Vimium on the other hand seems to scroll as long as the keydown event isn’t being cancelled by a keyup event, which works even with key‐repeat being disabled.About the search, <esc> cancels the search and hides it. The only reason the single key shortcut works then is because the next or previous shortcut will always bring up the search field. So using <esc> for this purpose doesn’t make sense. It already works by using the inbuilt <enter> and <shift-enter> to go through search results, but I think it would be easier to just allow any key. Confirming a search is cleaner than exiting it imo ^^
I’m only interested in local marks, allows you to quickly jump between one part of a long text to another, or yet another. It’s pretty versatile. It’s basically a more useful tabscroll.
- Shortcut for focusing the first visible text input.
Isn't this only useful with an option to prevent pages from focusing an input on load (e.g. Google, Bing, etc.)? In Vimium this option is named Don't let pages steal the focus on load.
Say you haven’t focused an input on a page, how do you select it for input? You press
f
and then whatever combination of keys is presented to you. Just pressinggi
is faster and I use it rather often. It has nothing to do with stealing focus on load and it’s calledfocusInput
in Vimium.- Shortcut for passing next key directly to page.
Can you explain an example use-case? I don't use this in Vimium and have no idea what it would look like in a generalized browser implementation.
The most basic example is triggering fullscreen on a video with
f
. Passes the key to webpage without triggering the link command.- Some way to disable all shortcuts a site might have set individually? Currently not even possible with Vimium.
See feature requests option to disable keyboard shortcut per webpage and Ctrl+Tab doesn't work. Adding to my list above...
We have a misunderstanding here. I’m talking about sites that have single key shortcuts set up, like Discord or Github. They cancel shortcuts keys that should normally trigger Vimium functions or even shortcuts setup by Vivaldi. It would be extremely useful, if Vivaldi could deny passing key events to a page when no input field is in focus.
What UI navigation would you want that doesn't come via Quick Commands or a keyboard shortcut? Vim has no UI to navigate, and ideally Vivaldi doesn't need a UI to navigate either.
First of all there aren’t commands present for all of Vivaldi’s functions, but more importantly you might want to navigate the UI, say to scroll through and edit/clean up your bookmarks with keyboard alone. Or just editing or creating a note. You can open the sidebar and go through the different panels with existing shortcuts, but there’s no good way to navigate within the panels. Same goes for managing your settings, or accessing your extensions when they are contracted but enabled. It’s meant to be done with mouse at present.
-
@luetage said in Vim-like keyboard interface:
The delay on scrolling with arrow keys isn’t a bug, it comes from the delay in key‐repeat settings directly from the operating system. Maybe you have no delay set. The difference to the Vimium implementation is that Vivaldi executes a scroll on first keydown event and then waits for another input, which will only happen after the set delay. Vimium on the other hand seems to scroll as long as the keydown event isn’t being cancelled by a keyup event, which works even with key‐repeat being disabled.
Ah, I see now what you're saying. And I have the same behavior. I just never noticed because I don't usually hold the key down.
About the search, <esc> cancels the search and hides it.... Confirming a search is cleaner than exiting it imo ^^
Vimium search operates by typing search term and hitting
Enter
which hides the search pane, and then next/previous results are obtained withn
/N
with the search pane hidden. CurrentlyEsc
in Vivaldi does exactly the same asEnter
in Vimium, since it hides the search pane and highlights the first search result. All that needs to change is for next/previous results to be obtainable withn
/N
.I’m only interested in local marks, allows you to quickly jump between one part of a long text to another, or yet another. It’s pretty versatile. It’s basically a more useful tabscroll.
Adding to my list above, but noting it's an advanced feature...
- Shortcut for focusing the first visible text input.
Isn't this only useful with an option to prevent pages from focusing an input on load (e.g. Google, Bing, etc.)? In Vimium this option is named Don't let pages steal the focus on load.
Say you haven’t focused an input on a page, how do you select it for input? You press
f
and then whatever combination of keys is presented to you. Just pressinggi
is faster and I use it rather often. It has nothing to do with stealing focus on load and it’s calledfocusInput
in Vimium.Adding to my list above, but noting it's an advanced feature...
- Shortcut for passing next key directly to page.
The most basic example is triggering fullscreen on a video withf
. Passes the key to webpage without triggering the link command.
Maybe the easiest way Vivaldi devs could implement this would be a new command named One-Time Disable Keyboard Shortcuts or more simply Ignore Next Keyboard Shortcut, which would be available right next to the existing Disable Keyboard Shortcuts command. Adding to my list above...
- What UI navigation would you want that doesn't come via Quick Commands or a keyboard shortcut? Vim has no UI to navigate, and ideally Vivaldi doesn't need a UI to navigate either.
First of all there aren’t commands present for all of Vivaldi’s functions, but more importantly you might want to navigate the UI, say to scroll through and edit/clean up your bookmarks with keyboard alone. Or just editing or creating a note. You can open the sidebar and go through the different panels with existing shortcuts, but there’s no good way to navigate within the panels. Same goes for managing your settings, or accessing your extensions when they are contracted but enabled. It’s meant to be done with mouse at present.
Adding to my list above...
- Some way to disable all shortcuts a site might have set individually? Currently not even possible with Vimium.
We have a misunderstanding here. I’m talking about sites that have single key shortcuts set up, like Discord or Github. They cancel shortcuts keys that should normally trigger Vimium functions or even shortcuts setup by Vivaldi. It would be extremely useful, if Vivaldi could deny passing key events to a page when no input field is in focus.
Regardless, shouldn't the discussion be in the threads I linked? I suggest adding your comments and upvotes to all the individual feature requests I linked, as they demonstrate broader interest for those features than just vimium users and imo are thus more likely to be noticed and implemented.
FYI, realistically I don't see Vivaldi devs ever implementing the advanced features unless one happens to start using them in Vimium and realizes the limitations due to being an extension rather than built-in. I've thus tried to separate between easily understood functionality and advanced features.