Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoselect match like autocomplete in completion #5358

Open
eyvindbjartiandersen opened this issue Apr 14, 2020 · 6 comments
Open

Autoselect match like autocomplete in completion #5358

eyvindbjartiandersen opened this issue Apr 14, 2020 · 6 comments
Labels
component: completion Issues related to the commandline completion or history. priority: 2 - low Issues which are currently not very important.

Comments

@eyvindbjartiandersen
Copy link

I searched for this feature because I thought it was implemented, but I guess it's a feature request. Is there a possibility to allow autoselecting the match while typing and effectively narrowing down the search matches at the same time in the completion?. Maybe with ESC to cancel/clear selection?.

@eyvindbjartiandersen eyvindbjartiandersen changed the title Autoselect like autocompletion. Autoselect match like autocomplete in completion. Apr 14, 2020
@The-Compiler
Copy link
Member

I don't understand what you mean. Can you elaborate?

@The-Compiler The-Compiler added the status: needs triage Issues/PRs which need some deeper investigation. label Apr 14, 2020
@eyvindbjartiandersen eyvindbjartiandersen changed the title Autoselect match like autocomplete in completion. Autoselect match like autocomplete in completion Apr 14, 2020
@eyvindbjartiandersen
Copy link
Author

For example in Neovims autocompletion you can choose to have the text autoinserted as you type. With Qutebrowser one would need to tab to the match when using :open.

@The-Compiler The-Compiler added component: completion Issues related to the commandline completion or history. priority: 2 - low Issues which are currently not very important. and removed status: needs triage Issues/PRs which need some deeper investigation. labels Apr 14, 2020
@The-Compiler
Copy link
Member

There already is some discussion in that direction in #5177 FWIW. I personally don't like that behavior and the completion handling is already quite complex, so unless others would like that as well, I'd rather not implement both.

@rcorre what's your take on this?

@rcorre
Copy link
Contributor

rcorre commented Apr 15, 2020

@eyvindbjartiandersen can you point me at the docs for this neovim setting? I'm having a hard time imagining how it would work for urls. Like, if I just type "g", would it immediately complete to the first url that has a "g" anywhere in it? Or would it just complete the longest unambiguous substring, like "h" would complete up to "http", then "s" would complete through "https://"? The former seems like it would have a lot of false positives, where the latter doesn't sound too useful as I never type the "https://" part when using qute's completion.

Maybe some examples would help us understand the desired behavior better?

@eyvindbjartiandersen
Copy link
Author

eyvindbjartiandersen commented Apr 15, 2020

The easiest way I can explain it is with this gif using Rofi: https://i.imgur.com/3dZUF1O.gif. The request concerns the selection of one entry at all times. This is the normal behaviour for most autocompleting implementations. Of course there'll be some implementation decisions/configuration options for accepting or declining the search match etc.

Rofi for example lets you configure VI style bindings:
! "Clear input line" Set from: XResources
rofi.kb-clear-line: ctrl+l
! "Beginning of line" Set from: Default
! rofi.kb-move-front: Control+a
! "End of line" Set from: Default
! rofi.kb-move-end: Control+e
! "Move back one word" Set from: XResources
rofi.kb-move-word-back: ctrl+n
! "Move forward one word" Set from: XResources
rofi.kb-move-word-forward: ctrl+i
! "Move back one char" Set from: Default
! rofi.kb-move-char-back: Left,Control+b
! "Move forward one char" Set from: Default
! rofi.kb-move-char-forward: Right,Control+f
! "Delete previous word" Set from: Default
! rofi.kb-remove-word-back: Control+Alt+h,Control+BackSpace
! "Delete next word" Set from: Default
! rofi.kb-remove-word-forward: Control+Alt+d
! "Delete next char" Set from: Default
! rofi.kb-remove-char-forward: Delete,Control+d
! "Delete previous char" Set from: Default
! rofi.kb-remove-char-back: BackSpace,Shift+BackSpace,Control+h

Example of how Neovim handles autocomplete and arbitrary text is not an issue: https://i.imgur.com/DunYucx.gif

This could be very neat to have in Qutebrowser IMHO.

@The-Compiler
Copy link
Member

I suppose that makes sense for prompts where you will most often want to select one of the given options, not enter free text (like it's case for a list of commands). However, with qutebrowser, for lots of commands (say, :open) you're probably more likely to want what you actually entered, not the first completion. Of course it'd be possible to have something like Mod-Enter to still accept the entered text, but I feel like this makes things more rather than less cumbersome in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: completion Issues related to the commandline completion or history. priority: 2 - low Issues which are currently not very important.
Projects
None yet
Development

No branches or pull requests

3 participants