Deno: docs: Describe how to configure shell completions

Created on 16 Jun 2020  路  3Comments  路  Source: denoland/deno

I would love to use the deno auto completions but cannot get them working with prezto.

deno completions zsh > /Users/marvinheilemann/.zprezto/modules/deno/init.zsh

It says _deno:12: command not found: _arguments. I wonder if I need additional steps but I couldn't find any.

Has anyone setup completions with prezto already or would it be possible to make it prezto compatible?

docs

Most helpful comment

@intgr thanks for explanation, we should add that to documentation.

All 3 comments

@muuvmuuv these completions are automatically generated by the CLI parser we're using - which is clap. It might be good to ask question there.

The issue is that zsh is very picky about how it discovers those completion files. You have to place it with file name _deno into some directory in the $fpath variable, usually /usr/local/share/zsh/site-functions. Unfortunately there are no user-local paths by default.

As a one-liner:

deno completions zsh |sudo tee /usr/local/share/zsh/site-functions/_deno

After that you can run compinit in your zsh shell and deno <TAB> should automagically work.

@intgr thanks for explanation, we should add that to documentation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sh7dm picture sh7dm  路  3Comments

benjamingr picture benjamingr  路  3Comments

ry picture ry  路  3Comments

ry picture ry  路  3Comments

zugende picture zugende  路  3Comments