-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
38 lines (33 loc) · 1 KB
/
init.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
" Neovim config
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc
" LSP + Python autocomplete plugins
Plugin 'neovim/nvim-lspconfig'
Plugin 'hrsh7th/cmp-nvim-lsp'
Plugin 'hrsh7th/cmp-buffer'
Plugin 'hrsh7th/nvim-cmp'
" Use the python3 command by default for lsp
let g:python3_host_prog = '/home/juanjux/pyenv/shims/python3'
let g:loaded_python_provider = 0
" Completion using pylsp and nvim-cmp
lua <<EOF
local cmp = require'cmp'
cmp.setup({
mapping = {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'buffer' }
}
})
-- Do this for each server plugin
require('lspconfig').pylsp.setup {
capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
}
EOF