惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
博客园 - 司徒正美
D
DataBreaches.Net
宝玉的分享
宝玉的分享
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
人人都是产品经理
人人都是产品经理
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
腾讯CDC
博客园_首页
The Cloudflare Blog
S
SegmentFault 最新的问题
C
Check Point Blog
美团技术团队
爱范儿
爱范儿
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN
Nvim Autocompletion with Deoplete
2019-06-06 · via jdhao's digital space

Note: this post is deprecated, I use nvim-cmp for auto-completion now.

Deoplete is a good auto-completion plugin for Neovim. In this post, I introduce how to set up auto-completion for Nvim with the help of deoplete.

Strictly speaking, it is an auto-completion engine. In order to enable auto-completion for a certain programming language, you need to install the corresponding source.

Install Deoplete#

To use deoplete, you should make sure that you are using Python3 . You need to install pynvim – the Python client to Neovim:

pip3 install --user pynvim

Deoplete is easy to install. You can install deoplete with vim-plug:

Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }

Since deoplete is a completion engine, in order to use auto-completion for a specific language, you need to install the corresponding source for it. The complete list of sources supporting deoplete can be found here.

Follow the guide of the specific completion source to install it and enable completion for that language. For example, you can check here on how to set up deoplete and deoplete-jedi for Python auto-completion.

The minimum settings on deoplete’s side is to enalbe it at the start of Nvim:

let g:deoplete#enable_at_startup = 1

Other settings#

Disable buffer and around source#

The buffer and around source for deoplete is of little use for auto-completion. I would rather ignore them. To ignore these two sources, use the following settings:

call deoplete#custom#option('ignore_sources', {'_': ['around', 'buffer']})

References#

change the max width of the completion window#

Sometimes, the completion term has long strings which are cut down due to limited completion window width. So change the max width allowed for completion window, use the following settings:

" maximum candidate window length
call deoplete#custom#source('_', 'max_menu_width', 80)

References#