1995eaton / chromium-vim

Vim bindings for Google Chrome.
https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojhcghmfjfneahoeklbjjh
MIT License
2.25k stars 327 forks source link

Able to default to first completion when opening new buffers? #335

Open anoda9 opened 9 years ago

anoda9 commented 9 years ago

(Apologies if there is already a way to do this that I missed while reading the help page)

It'd be great if there was a preference that let cvim default to the 1st completion when opening new buffers, rather than opening a google search.

To illustrate: currently, if I want to open a new tab with GitHub, I type "t", then "gith...", then press tab to select the 1st autocomplete result, then press enter. What I'd prefer to do: type "t", then "githu...", then press enter and have cvim follow the 1st autocomplete result, without having to bother with tab. Opening a search could be moved to be the 2nd default option, so if I wanted to google "githu", I could type "gith...", press tab once to select the "google gith" autocompletion.

This would be very useful since I find the most common action when browsing is opening an address that you have already visited before (not searching google for a phrase.)

257 commented 9 years ago

yes that... just like chrome's own omnibox behaviour. also first should delete the suggestion (or 1st autocomplete as it was called in the original post) and then the second would delete the last chat typed in. again same behaviour as the omnibox.

bleader commented 9 years ago

:+1: I agree not having to type tab would be nice. Althrough it is not matching vim behavior, auto completion suggestions are not a vim behavior either, that may be why it does not feel the same. Given vim won't suggest command or filename until you press tab, it does not actually feel the same. The auto suggestion tend to allow filtering and reflex is then to simply press return once you filtered enough.

I think this is relevant for all command having completion suggestions: tabnew, open, buffer probably some other too.

anoda9 commented 9 years ago

I'm glad that people find this to be a useful suggestion. It's interesting to note the difference in response compared to the vimperator page: https://github.com/vimperator/vimperator-labs/issues/263. If someone had reservations about this suggestion, I provide additional arguments for it there.

bleader commented 9 years ago

Maybe we're the only 3 people around here who would be interested in this behavior :)

1995eaton commented 9 years ago

This now works with the completeonopen option. Add set completeonopen to your config and it should work.

257 commented 9 years ago

not working here. here is my config file: https://gist.github.com/257/b488307967e364cbabeb

257 commented 9 years ago

hmm, Readme.md explains this as: "Automatically show a list of command completions when the command bar is opened" not sure if that what this issue is about. "Able to default to first completion when opening new buffers".

dumblob commented 8 years ago

In case the completeonopen option should do what @anoda9 proposed, it doesn't work for me in Chromium 53.0.2785.101 (64-bit) on Linux.

@1995eaton, is there any current way how to achieve auto selection of the first item?

dumblob commented 7 years ago

Ping @1995eaton.