From ad114c0daac3a0da84f875ce5127ac0ac978466d Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Tue, 25 Jul 2023 23:34:16 +0200 Subject: nvim: remove vsnip + snip completion + add ghost text --- nvim.init.vim | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/nvim.init.vim b/nvim.init.vim index 62bcf6f..2732f02 100644 --- a/nvim.init.vim +++ b/nvim.init.vim @@ -13,20 +13,16 @@ call plug#begin('~/.nvim/plugged') " Colors. Plug 'chriskempson/base16-vim' - " vsnip manager. - Plug 'hrsh7th/vim-vsnip' - " LSP. Plug 'neovim/nvim-lspconfig' " Completion framework. Plug 'hrsh7th/nvim-cmp' " Completion sources. - Plug 'hrsh7th/cmp-vsnip' Plug 'hrsh7th/cmp-nvim-lsp' Plug 'hrsh7th/cmp-nvim-lsp-signature-help' Plug 'hrsh7th/cmp-buffer' - Plug 'hrsh7th/cmp-path' - Plug 'hrsh7th/cmp-cmdline' + "Plug 'hrsh7th/cmp-path' + "Plug 'hrsh7th/cmp-cmdline' " Telescope. Plug 'nvim-lua/plenary.nvim' @@ -90,27 +86,23 @@ lua << EOF local cmp = require'cmp' cmp.setup({ - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) - end, - }, mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = false }), + [''] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'nvim_lsp_signature_help' }, }, { - { name = 'vsnip' }, { name = 'buffer' }, - { name = 'path' } - }) + -- { name = 'path' } + }), + experimental = { + ghost_text = true + }, }) -- Setup lspconfig. @@ -171,7 +163,6 @@ nnoremap lua vim.lsp.buf.definition() nnoremap lua vim.lsp.buf.type_definition() nnoremap K lua vim.lsp.buf.hover() nnoremap lua vim.lsp.buf.signature_help() -inoremap lua vim.lsp.buf.signature_help() nnoremap r lua vim.lsp.buf.references() nnoremap i lua vim.lsp.buf.implementation() nnoremap f lua vim.lsp.buf.format() -- cgit v1.2.3