elvish
elvish copied to clipboard
[FR] Completions directory on Linux
Bash, fish, and zsh all have a completions directory on Linux, where applications can add their completion files. Does Elvish have anything similar? If not, consider this a feature request.
- Bash:
/usr/share/bash-completion/completions/
- Fish:
/usr/share/fish/completions/
- Zsh:
/usr/share/zsh/vendor-completions/
Completion files can be installed like other modules into a global module search directory (https://elv.sh/ref/command.html#module-search-directories).
There is no automatic discovery of completion files though; the user would have to import them manually with use
.
Would it be feasible to implement automatic discovery of completion files?
Would it be feasible to implement automatic discovery of completion files?
Yes, but it probably requires some discussion over a period of several months to determine if the pro's outweigh the con's. At this time Elvish does not automatically import any module other than builtin
. So one con is that automatically importing completion modules is behavior different than for non-completion modules. On the other hand, interactive command completion modules are fundamentally different from non-completion modules and it might be friendlier to automatically import them. On the other hand, a completion module can contain arbitrary Elvish code -- not just command completion code. And thus auto-importing completion modules could be abused to bypass the usual requirement to use
a module. That could, perhaps, be mitigated by putting completion modules in a special namespace that isn't searched when resolving an interactive command.