diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-07-25 23:34:16 +0200 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-07-25 23:34:16 +0200 |
commit | ad114c0daac3a0da84f875ce5127ac0ac978466d (patch) | |
tree | 6bc646e21691148699d0f6c4f9da5f722e0d7ecb /nvim.init.vim | |
parent | 752603091c084db69583faabc5b2986d624c6fee (diff) | |
download | dotfiles-ad114c0daac3a0da84f875ce5127ac0ac978466d.tar.gz dotfiles-ad114c0daac3a0da84f875ce5127ac0ac978466d.zip |
nvim: remove vsnip + snip completion + add ghost text
Diffstat (limited to 'nvim.init.vim')
-rw-r--r-- | nvim.init.vim | 25 |
1 files 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({ ['<C-u>'] = cmp.mapping.scroll_docs(-4), ['<C-d>'] = cmp.mapping.scroll_docs(4), ['<C-Space>'] = cmp.mapping.complete(), ['<C-e>'] = cmp.mapping.abort(), - ['<CR>'] = cmp.mapping.confirm({ select = false }), + ['<CR>'] = 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 <silent> <C-]> <cmd>lua vim.lsp.buf.definition()<cr> nnoremap <silent> <leader><C-]> <cmd>lua vim.lsp.buf.type_definition()<cr> nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<cr> nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<cr> -inoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<cr> nnoremap <silent> <leader>r <cmd>lua vim.lsp.buf.references()<cr> nnoremap <silent> <leader>i <cmd>lua vim.lsp.buf.implementation()<cr> nnoremap <silent> <leader>f <cmd>lua vim.lsp.buf.format()<cr> |