zsh-autosuggestions icon indicating copy to clipboard operation
zsh-autosuggestions copied to clipboard

[FR] Include files as a suggestion to the command

Open NightMachinery opened this issue 4 years ago • 0 comments

This is a resubmit of https://github.com/zsh-users/zsh-autosuggestions/issues/584 .

Is your feature request related to a problem? Please describe.

In most of the cases the user would be traversing some files from directory, so what if that is also provided as a suggestion

Describe the solution you'd like

suppose user types some command, then this plugin would complete it with first file/directory by order, by modified time or by alphabetical order as a suggestion
eg, whenever user types cd /usr/local/ plugin completes it with cd /usr/local/bin

Describe alternatives you've considered

currently users keep hitting tabs until what they want is suggested to them, that can be made easier using this plugin

Additional context

This suggestion can be made only if current suggestion based on history returns none

In that thread, using the completion engine is recommended. This has two drawbacks:

  • The user might not want to use the completion engine, but might still want file completions; Running completions can be very expensive.
  • The completion functions might not return files. For example, I have a lot of my functions reuse =which='s completor (they are mostly higher-order functions that have other functions for their input), and this completor does not return filenames.

NightMachinery avatar Apr 12 '21 16:04 NightMachinery