From a37ceaed83181ac27ecea78a69baf66e2f4d023f Mon Sep 17 00:00:00 2001 From: jay Date: Wed, 27 Apr 2022 12:27:21 +0800 Subject: [PATCH] update --- nvim/init.vim | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/nvim/init.vim b/nvim/init.vim index 7d5c897..8bbd37e 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -30,6 +30,8 @@ Plug 'hrsh7th/cmp-cmdline' Plug 'hrsh7th/cmp-vsnip' Plug 'hrsh7th/vim-vsnip' +Plug 'ray-x/lsp_signature.nvim' + Plug 'tomasr/molokai' Plug 'scrooloose/nerdcommenter' Plug 'vim-scripts/DrawIt' @@ -320,6 +322,12 @@ lua << EOF local nvlsp = require'lspconfig' +local lspSig = require'lsp_signature' + +lspSig.setup{ + hint_enable = true, +} + -- Add additional capabilities supported by nvim-cmp local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) @@ -330,6 +338,8 @@ local on_attach = function(client, bufnr) local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end + lspSig.on_attach() + -- Enable completion triggered by buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') @@ -374,13 +384,13 @@ nvlsp['rust_analyzer'].setup{ -- nvim-cmp setup local cmp = require 'cmp' cmp.setup { - mapping = { + mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.confirm({ -- behavior = cmp.ConfirmBehavior.Insert, select = true, }), -- [''] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 's' }), - }, + }), snippet = { -- REQUIRED - you must specify a snippet engine expand = function(args)