Hacker News new | past | comments | ask | show | jobs | submit login

Elvish has a really simple API for writing completers (https://elv.sh/ref/edit.html#completion-api). The simplicity of the API stems from some fundamental language features like first-class functions, value pipes and composite data types. In more traditional shells without these language features (including fish), the completer API is usually made up of obscure naming conventions, specialized command for outputting candidates and controlling the format, etc.

I think Elvish's simple completer API (which is very similar to completion protocols used by editors, FWIW) is proof that serious programming capabilities is actually quite essential for a shell. You wouldn't write editor plugins using bash, but people have to write completers and other shell plugins in bash all the time.

However, what would affect your day to day experience the most is probably the coverage of existing completers. There are some community efforts you can find in https://github.com/elves/awesome-elvish#completion-scripts, but it's quite clear that Elvish is lagging behind.

This is mostly because I'm still trying to figure out a lot of things in the language itself, and I don't want people to invest a lot of completers before they get broken by language changes. Once the language becomes more stable (which will perhaps take another year or so) I'll invest much more in this area.




The API looks awesome. But when I tried it just now, I see no color in the terminal, and it does not have anything like the completion I see in fish.

I don't know if you have tried it but fish basically predicts what you are going to enter based on the directory you are in and what you have entered before and gives a preview as you are typing, and then you can hit the right arrow to complete it.

Since that is extremely convenient for me and your shell seems to not have color (at least not in my Ubuntu terminal right now), I am going to stick with fish.


> "There are some community efforts you can find in https://github.com/elves/awesome-elvish#completion-scripts, but it's quite clear that Elvish is lagging behind."

clap-rs, which is a popular command line parser for Rust, can generate Elvish completion scripts automatically and it works really well. Maybe you want to add that to the list.


This is really exciting. I've been using zsh for years but would probably change to this shell with better completions and theming.




Applications are open for YC Winter 2021

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: