Convert Figma logo to code with AI

Shougo logodeoplete.nvim

:stars: Dark powered asynchronous completion framework for neovim/Vim8

5,934
295
5,934
1

Top Related Projects

24,306

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.

A completion plugin for neovim coded in Lua.

A code-completion engine for Vim

3,103

async language server protocol plugin for vim and neovim

Quick Overview

Deoplete.nvim is a powerful asynchronous completion framework for Neovim. It provides fast, extensible, and context-aware auto-completion functionality, enhancing the coding experience for Neovim users.

Pros

  • Asynchronous completion, ensuring smooth performance
  • Extensive plugin ecosystem for various languages and frameworks
  • Highly customizable with numerous configuration options
  • Supports multiple sources for completion suggestions

Cons

  • Requires Neovim (not compatible with standard Vim)
  • Can be complex to set up and configure for optimal performance
  • May have a steeper learning curve compared to simpler completion plugins
  • Occasional conflicts with other plugins or language servers

Code Examples

  1. Basic configuration in init.vim:
" Enable deoplete at startup
let g:deoplete#enable_at_startup = 1

" Set minimum syntax keyword length
let g:deoplete#sources#syntax#min_keyword_length = 3

" Define keyword patterns for specific filetypes
call deoplete#custom#option('keyword_patterns', {
    \ 'default': '\h\w*',
    \ 'python': '[a-zA-Z_]\w*',
    \})
  1. Customizing completion sources:
" Disable the buffer source for all filetypes
call deoplete#custom#option('sources', {
    \ '_': ['file', 'neosnippet'],
    \})

" Use a specific source for Python files
call deoplete#custom#option('sources', {
    \ 'python': ['jedi'],
    \})
  1. Setting up key mappings:
" Use Tab to cycle through completion options
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"

" Use Shift+Tab to cycle backwards
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<S-TAB>"

" Use Enter to select completion
inoremap <silent><expr><CR> pumvisible() ? deoplete#close_popup() : "\<CR>"

Getting Started

  1. Install Neovim (version 0.3.0 or later)
  2. Install deoplete.nvim using your preferred plugin manager (e.g., vim-plug)
  3. Add the following to your init.vim:
call plug#begin()
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
call plug#end()

let g:deoplete#enable_at_startup = 1
  1. Restart Neovim and run :PlugInstall
  2. (Optional) Install additional completion sources for specific languages

Competitor Comparisons

24,306

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.

Pros of coc.nvim

  • Supports a wider range of programming languages and file types
  • Offers more advanced features like code actions, refactoring, and diagnostics
  • Integrates seamlessly with Language Server Protocol (LSP)

Cons of coc.nvim

  • Heavier resource usage, potentially slower on older machines
  • Steeper learning curve due to more complex configuration options
  • Requires Node.js as a dependency

Code Comparison

coc.nvim configuration example:

let g:coc_global_extensions = ['coc-json', 'coc-tsserver']
inoremap <silent><expr> <TAB>
      \ pumvisible() ? "\<C-n>" :
      \ <SID>check_back_space() ? "\<TAB>" :
      \ coc#refresh()

deoplete.nvim configuration example:

let g:deoplete#enable_at_startup = 1
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"

Both plugins aim to provide autocompletion for Neovim, but coc.nvim offers a more comprehensive feature set with LSP integration, while deoplete.nvim focuses on lightweight, fast autocompletion. The choice between them depends on the user's specific needs and system capabilities.

A completion plugin for neovim coded in Lua.

Pros of nvim-cmp

  • Built-in support for LSP completions
  • Highly customizable with a modular architecture
  • Faster performance, especially with large codebases

Cons of nvim-cmp

  • Steeper learning curve for configuration
  • Requires more manual setup compared to deoplete

Code Comparison

nvim-cmp configuration:

require('cmp').setup({
  sources = {
    { name = 'nvim_lsp' },
    { name = 'buffer' },
  },
})

deoplete configuration:

let g:deoplete#enable_at_startup = 1
call deoplete#custom#option('sources', {
\ '_': ['buffer'],
\ 'cpp': ['buffer', 'tag'],
\})

Summary

nvim-cmp offers more advanced features and better performance, particularly for LSP-based completions. It provides greater flexibility but requires more setup. deoplete is easier to configure out of the box but may not offer the same level of customization or performance for complex workflows. The choice between the two depends on the user's needs and willingness to invest time in configuration.

A code-completion engine for Vim

Pros of YouCompleteMe

  • More comprehensive language support out of the box
  • Semantic completion for C-family languages
  • Integrates with external tools for enhanced functionality

Cons of YouCompleteMe

  • Heavier and more complex setup process
  • Requires compilation and external dependencies
  • Can be resource-intensive, especially on older hardware

Code Comparison

YouCompleteMe configuration:

let g:ycm_auto_trigger = 1
let g:ycm_min_num_of_chars_for_completion = 2
let g:ycm_complete_in_comments = 1

deoplete.nvim configuration:

let g:deoplete#enable_at_startup = 1
call deoplete#custom#option('auto_complete_delay', 200)
call deoplete#custom#option('smart_case', v:true)

YouCompleteMe offers more granular control over completion behavior, while deoplete.nvim focuses on simplicity and ease of configuration. YouCompleteMe's semantic completion provides more accurate results for supported languages, but deoplete.nvim's modular approach allows for easier extension and customization.

Both plugins aim to provide efficient autocompletion, but they cater to different user preferences and requirements. YouCompleteMe is better suited for users who need advanced features and are willing to invest time in setup, while deoplete.nvim is ideal for those who prefer a lightweight, easily configurable solution.

3,103

async language server protocol plugin for vim and neovim

Pros of vim-lsp

  • Lightweight and focused solely on Language Server Protocol (LSP) integration
  • Supports a wide range of language servers out of the box
  • Easy to configure and extend with custom language servers

Cons of vim-lsp

  • Requires additional plugins for autocompletion functionality
  • May have a steeper learning curve for users new to LSP concepts
  • Less extensive ecosystem compared to deoplete.nvim

Code Comparison

vim-lsp configuration:

let g:lsp_signs_enabled = 1
let g:lsp_diagnostics_echo_cursor = 1
let g:lsp_text_edit_enabled = 1

if executable('pyls')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pyls',
        \ 'cmd': {server_info->['pyls']},
        \ 'whitelist': ['python'],
        \ })
endif

deoplete.nvim configuration:

let g:deoplete#enable_at_startup = 1
call deoplete#custom#option('sources', {
\ '_': ['buffer', 'file', 'neosnippet'],
\ 'python': ['jedi'],
\})

While vim-lsp focuses on LSP integration, deoplete.nvim provides a more comprehensive autocompletion framework with various sources. vim-lsp requires more explicit configuration for language servers, whereas deoplete.nvim offers a broader range of completion sources out of the box.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

deoplete.nvim

Dark powered asynchronous completion framework for neovim/Vim8

Note: The development of this plugin is finished. Accepts minor patches and issues but no new features. ddc.vim is the next generation auto completion plugin. Consider migrating to it.

Join the chat at https://gitter.im/Shougo/deoplete.nvim Doc

Please read help for details.

Note: If you need to understand what's different between deoplete and other similar plugins, please read "deoplete-faq" section in the documentation.

Deoplete is the abbreviation of "dark powered neo-completion". It provides an extensible and asynchronous completion framework for neovim/Vim8.

deoplete will display completions via complete() by default.

Here are some completion sources specifically made for deoplete.nvim.

Install

Note: deoplete requires Neovim (0.3.0+ and of course, latest is recommended) or Vim8.2.1978+ with Python 3.6.1+ and timers enabled. See requirements if you aren't sure whether you have this.

Note: deoplete requires msgpack package 1.0.0+. Please install/upgrade msgpack package by pip. https://github.com/msgpack/msgpack-python

Note: If you really need to use older msgpack, please use deoplete ver.5.2 instead.

https://github.com/Shougo/deoplete.nvim/releases/tag/5.2

For vim-plug

if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
  Plug 'Shougo/deoplete.nvim'
  Plug 'roxma/nvim-yarp'
  Plug 'roxma/vim-hug-neovim-rpc'
endif
let g:deoplete#enable_at_startup = 1

For dein.vim

call dein#add('Shougo/deoplete.nvim')
if !has('nvim')
  call dein#add('roxma/nvim-yarp')
  call dein#add('roxma/vim-hug-neovim-rpc')
endif
let g:deoplete#enable_at_startup = 1

Vim >= 8 built-in package manager (not recommended)

  1. Clone the repo in a package (e.g. $XDG_CONFIG_HOME/nvim/pack/dist/start, where dist is the name of the package)

  2. Write call deoplete#enable() or let g:deoplete#enable_at_startup = 1 in your init.vim

  3. Inside NeoVim, call :UpdateRemotePlugins

Requirements

deoplete requires Neovim or Vim8 with if_python3.

If :echo has("python3") returns 1, then you have python 3 support; otherwise, see below.

You can enable Python3 interface with pip:

pip3 install --user pynvim

Please install nvim-yarp and vim-hug-neovim-rpc for Vim8.

Note: Python3 must be enabled before updating remote plugins

If Deoplete was installed prior to Python support being added to Neovim, :UpdateRemotePlugins should be executed manually in order to enable auto-completion.

Note: deoplete needs pynvim ver.0.3.0+.

You need update pynvim module.

pip3 install --user --upgrade pynvim

If you want to read the Neovim-python/python3 interface install documentation, you should read :help provider-python and the Wiki. https://github.com/deoplete-plugins/deoplete-jedi/wiki/Setting-up-Python-for-Neovim

Configuration

" Use deoplete.
let g:deoplete#enable_at_startup = 1

See :help deoplete-options for a complete list of options.

Screenshots

Deoplete for JavaScript https://www.youtube.com/watch?v=oanoPTpiSF4

File Name Completion

Omni Completion

Neosnippets and neco-ghc integration

deoplete + echodoc integration

deoplete + deoplete-go integration

deoplete + deoplete-typescript integration

Python completion using deoplete-jedi

C++ completion using clang_complete

Java completion using vim-javacomplete2

Vim Script completion using neco-vim

C# completion using deoplete-omnisharp

Register/Extract list completions

FSharp completion using deopletefs

Typescript

Javascript

Css, scss, sass

Html

My custom snippets

C++ with cquery lang server

Rust using rls

Ruby dictionary completion

LanguageClient-neovim integration