jandamm / cmp-zsh

nvim-cmp source for zsh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cmp-zsh

Zsh completion source for nvim-cmp

Requirements

zmodload zsh/zpty

Installation

Plug 'hrsh7th/nvim-cmp'
Plug 'tamago324/cmp-zsh'
Plug 'Shougo/deol.nvim'      " recommended to use together.

lua << EOF
require'cmp'.setup {
  -- ...
  sources = {
    { name = 'zsh' }
  }
}
EOF

Configuration

It saves compdump file in $COMPE_ZSH_CACHE_DIR or $XDG_CACHE_HOME or $HOME/.cache directory.

In order to show completions defined in your zshrc you can setup cmp zsh like this. Note: This feature is experimental. If you enable it and don't get any results try disabling it.

require'cmp_zsh'.setup {
  zshrc = true -- Source the zshrc (adding all custom completions)
}

Alternatively you can use this trick (if sourcing your zshrc is very slow): Add the directory of the complete function to $FPATH in ~/.zshenv.

# completions
if [ -d $HOME/.zsh/comp ]; then
    export FPATH="$HOME/.zsh/comp:$FPATH"
fi

Credit

License

MIT

About

nvim-cmp source for zsh

License:MIT License


Languages

Language:Shell 60.4%Language:Lua 39.6%