Giter VIP home page Giter VIP logo

Comments (11)

chrisant996 avatar chrisant996 commented on June 16, 2024 1

For example, in this scenario, I would think that I could select the selected suggestion with the arrow right. But it just selects the next item from the list. I mean yes if I had multiple items so that they would be displayed next to each other then it would make sense again, but if you only have a few items it is quite confusing. Especially if you are used to using an IDE.

image

The clink-select-complete command has its own non-configurable key bindings. The arrow keys are for navigating around the list. If Right did something else instead of navigation, then either navigation wouldn't be possible, or the list would never be able to have more than 1 column. Those aren't acceptable limitations.

@Mqxx For comparison, look at how completion works in Powershell or in the fish shell.



Anyway, I understand your overall expectation. I'm reluctant to introduce the requested behavior, because no command shells work that way currently. And it's fundamentally incompatible with the menu-complete commands. I think this is a case where the most effective solution is to adapt to how command shells work.

The auto-suggestion feature is the outlier. If it's creating confusing or dissatisfaction, then turn it off. Turning it off seems better than altering lots of other things to morph the auto-suggestion into a different kind of feature, where Tab inserts a displayed preview (in apps that do that, that's their only form of "completion"-like behavior, and they're riffing off of how completion has already worked for decades in command shells).

clink set autosuggest.enable false

from clink.

chrisant996 avatar chrisant996 commented on June 16, 2024

@Mqxx I'm sorry but I think you're mixing up "auto-suggestions" versus "completions". They're different features for different purposes.

For example see Feature Highlights.

Tab already is the completion key, and the are a few different styles of completion commands (not to be confused with auto-suggestions). Have you looked at the documentation on setting key bindings?

from clink.

chrisant996 avatar chrisant996 commented on June 16, 2024

Duplicate of #475.

from clink.

Mqxx avatar Mqxx commented on June 16, 2024

Ahh okay I see. Thanks. Yea I think out of my intuition I would press TAB when I see the gray auto suggestion.

from clink.

Mqxx avatar Mqxx commented on June 16, 2024

I now understand the difference between auto-suggestion vs. competion. But is it still possible to complete the suggestion using TAB instead of the arrow right?

from clink.

chrisant996 avatar chrisant996 commented on June 16, 2024

@Mqxx Yes, it's possible to change any and all key bindings in Clink. I really don't think changing Tab to insert an auto-suggestion will result in a good experience. I think it'd be better to turn off auto-suggestions, and let Tab continue to do completion.

I'd recommend starting at the Getting Started section of the documentation. It quickly gets to a part about key bindings, which has a link to details about how to customize key bindings. There's a lot of other useful info as well in the getting started sections.

from clink.

Mqxx avatar Mqxx commented on June 16, 2024

Thanks for the support! I'll have a look at this.

from clink.

Mqxx avatar Mqxx commented on June 16, 2024

I really don't think changing Tab to insert an auto-suggestion will result in a good experience.

I wouldn't necessarily say that... In every modern IDE or in other command lines, TAB is used as a keybind for accepting suggestions.

For example, in this scenario, I would think that I could select the selected suggestion with the arrow right. But it just selects the next item from the list. I mean yes if I had multiple items so that they would be displayed next to each other then it would make sense again, but if you only have a few items it is quite confusing. Especially if you are used to using an IDE.

image

Here I would think that pressing TAB would complete the suggestion. But it does not 😅

image

It autocompletes (or say, selects) the next entry.

image

I have looked at the possible keybindings in the documentation, but I have not found a setting where I can change the whole thing for auto-suggest... As far as I have seen, it is permanently bound to arrow right. The only thing I have seen that I can customize is the keybind for completion.

from clink.

chrisant996 avatar chrisant996 commented on June 16, 2024

I wouldn't necessarily say that... In every modern IDE or in other command lines, TAB is used as a keybind for accepting suggestions.

In all command shells, the Tab key performs what is known as "completion".

There are no command shells where Tab performs the behavior associated with the gray text in the Clink "auto-suggestions" feature.

The auto-suggestions feature in Clink is the same as the auto-suggestions feature in the famous fish shell.

I have looked at the possible keybindings in the documentation, but I have not found a setting where I can change the whole thing for auto-suggest...

clink-insert-suggested-line

"\t": clink-insert-suggested-line

As far as I have seen, it is permanently bound to arrow right.

You said you want Tab to insert the suggestion. That's totally possible; see above.

But did you mean to imply that you also want to make Right never insert the auto-suggestion text? I'm not going to build that. That would greatly complicate everything about the auto-suggestions feature.

I would recommend to completely turn off auto-suggestions, instead. It is not intended to work how you're suggesting. It is much, much less powerful/flexible than completions in general. The main purpose of auto-suggestions is to offer the most recent command from the history matching what's been typed so far, or if there are no matches then offer the first possible completion. It's a weak convenience: you could access the most recent history entry with PgUp (or like I did, change your Up binding), and you could access the first completion by pressing Tab.

from clink.

Mqxx avatar Mqxx commented on June 16, 2024

But did you mean to imply that you also want to make Right never insert the auto-suggestion text?

No

clink-insert-suggested-line

Thanks this is what I was searching for.

Is there also a way to influence the behavior of Popup Window? For example, I want Tab to insert the currently highlighted item instead of Enter from the list.

from clink.

chrisant996 avatar chrisant996 commented on June 16, 2024

Is there also a way to influence the behavior of Popup Window? For example, I want Tab to insert the currently highlighted item instead of Enter from the list.

The popup list key bindings are not configurable.

The documentation section on how they work covers the keys they recognize.

from clink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.