halloy icon indicating copy to clipboard operation
halloy copied to clipboard

[Feature Request] tab completion for / commands

Open ndrew222 opened this issue 8 months ago • 5 comments

I see that when you type /, a completion menu pops up. It would be great if you could press Tab to access the suggestions.

Even better would be to add subcommand completion, but I'm not sure how that would be implemented

ndrew222 avatar Apr 11 '25 04:04 ndrew222

Just in case you weren't aware, you can access the suggestions via Tab then Enter to select the highlighted entry (which inserts it into the text input). An option could be added to have the command inserted via Tab itself.

I like the idea of adding auto-completion to sub-commands. In the meantime, sub-commands are currently listed in the tooltip of the sub command argument in the command description (if enabled).

andymandias avatar Apr 12 '25 00:04 andymandias

Oh! I was not able to see that because the highlighted entry is so barely highlighted in my current theme lmao Thanks

ndrew222 avatar Apr 15 '25 02:04 ndrew222

do you know which parameter in the theme I should change for the command highlight?

ndrew222 avatar Apr 15 '25 02:04 ndrew222

I'd like to see this happen, too.

To my experience, there are two styles for choosing completion candidates from a tooltip or pop-up:

  • TAB cycles through the candidates, RET inserts the candidate
  • arrow up/down selects the candidate, TAB inserts it

In that light, a new configuration option would probably be needed to switch between the two.

For the sake of example:

# Type: string
# Values: "enter", "tab"
# Default: "enter"

[buffer.text_input.autocomplete]
insert_key = "enter"

c-alpha avatar Apr 16 '25 13:04 c-alpha

It would also seem useful to me, if it were possible to turn off the wrap-around between completion candidates, i.e. so that it stops when the first or last candidate is reached.

For instance:

# Type: boolean
# Values: true, false
# Default: true

[buffer.text_input.autocomplete]
cycle = true

c-alpha avatar Apr 16 '25 14:04 c-alpha