Rustdoc: Use '/' key to search instead of 'S'

Github, Gitlab and other platforms use the slash key to start a search, but rustdoc uses 'S', which is less common and more difficult to type. Would it be possible to change the key to '/' or at least allow both keys to start the search?

Thanks for your time.

12 Likes

Heh, I wish / was easy to type in many European keyboard layouts, including mine, rather than being one of the most difficult ones (shift-7)…

13 Likes

GitHub and GitLab presumably use / because it's the standard Vi key binding for starting a search. Funnily, Google Drive, which is not targetted at users who know what Vim is, likewise uses / to focus its search bar.

5 Likes

GitHub also searches with S. In fact, just now I realized it also uses / for searching...

1 Like

Yeah, it's something of a de facto standard, although maybe not very well known. Indeed Discourse also supports /. Gmail as well. And Firefox unless the page captures it itself.

2 Likes

It gets worse though, at least in Swedish layout you need AltGr for []{}. And ~ is a dead key, so that needs a space afterwards... The back tick of markdown is also a dead key.

Yes, I feel your pain. Honestly I'm not sure why I haven't just learned to use the US layout for coding ages ago. (Also, on Mac, {} are shift-alt-8/9…)

I'm German, but I happily moved to a US keyboard many years ago, that's much more comfortable and you notice how many things depend on that layout.

But to get back on topic, was it correct to open this discussion here or what else can I do to make progress on the proposal?

1 Like

I'm using a Hungarian layout, where / would be a combination, but it's fortunately accessible on the numpad.

Also, I don't see why it couldn't be both s and / if that's easier for some?

1 Like

I don't see a problem with supporting both.

6 Likes

I think we can support both easily, and I opened the PR

6 Likes

(off topic)

I'm spanish and the layout is terrible for coding. I moved to a US layout a few years ago and I can't be happier with the result, it doesn't take that long to get used to.

The only problem is with with typing spanish characters, what I usually do is to change layouts (windows) or compose key (linux)

Im opposed to overloading hotkeys already used by browsers.

“/“ starts “Quick Find in Page” in Firefox. Keyboard shortcuts - Perform common Firefox tasks quickly | Firefox Help

Already far too many sites hijack the Ctrl+K shortcut for their search box, which natively focuses the Firefox search box.

“S” is a joy to use. It is simple and does not conflict with other key bindings.

3 Likes

Vi man flies in

It sounds like you want…modal bindings :slight_smile: . I get it with SurfingKeys in Firefox, but pretty much everything I use has some modal bindings (i for Firefox, Ctrl-I for my window manager, Ctrl-A for tmux, nvim is…nvim).