4 ms·
I hate how complex it to write a decent zsh completion. It is not something you can realistic do in a weekend. You can implement a simple one without much effo
by boibombeiro 5y ago
I hate how complex it to write a decent zsh completion. It is not something you can realistic do in a weekend.
You can implement a simple one without much effort. But doing anything a bit more interesting need to dig into zle, and there is only a few resources available online.
- GhettoComputers 5y agoFish has sane defaults. I don’t think using shell scripts is a great idea. The creator of oil shell pops up pretty often, he has some default scripts that might be useful for some. Also I should add you can use it interactively in bash. https://wiki.archlinux.org/title/fish#Setting_fish_as_interactive_shell_only https://wiki.archlinux.org/title/fish#Setting_fish_as_intera...
- mschrage 5y agoIf you want to play around with writing more 'interesting' completions, check out Fig (https://github.com/withfig/autocomplete https://github.com/withfig/autocomplete). You can write completions declaratively and use TypeScript to generate dynamic suggestions. Disclosure: I'm one of the founders.
- boibombeiro 5y agoLooks neat. I've though about using tree-sitter DSL to generate zsh completion. Your project seems to be a better candidate for this. Tree-sitter DSL, with some extra annotations, could be used to generate the specification. With the added bonus of being a format that can provide syntax highlight on text editors (in commands in sh files). If I not mistaken, tree-sitter also uses TS. I only gave a quick look at fig (only use HN on mobile). Will have a better look when at the desktop.