From a199c64f283f6f2e50da63c44c1bb9973675fd32 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Wed, 16 Mar 2022 01:07:27 -0500 Subject: [PATCH] Add some useful bindings --- common/neovim/lua/lsp.lua | 3 ++- common/neovim/lua/plugins.lua | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common/neovim/lua/lsp.lua b/common/neovim/lua/lsp.lua index e32ce58..1c92abe 100644 --- a/common/neovim/lua/lsp.lua +++ b/common/neovim/lua/lsp.lua @@ -18,7 +18,8 @@ local on_attach = function(_, bufnr) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'i', '', 'lua vim.lsp.buf.signature_help()', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) diff --git a/common/neovim/lua/plugins.lua b/common/neovim/lua/plugins.lua index a6dd337..a8d91f2 100644 --- a/common/neovim/lua/plugins.lua +++ b/common/neovim/lua/plugins.lua @@ -10,6 +10,7 @@ local has_words_before = function() end local packer = require'packer' + packer.startup(function() local plugins = { 'wbthomason/packer.nvim', -- neovim plugin manager @@ -64,6 +65,7 @@ packer.startup(function() 'neovim/nvim-lspconfig', -- language server configuration helper 'williamboman/nvim-lsp-installer', -- plugin containing installation commands for many language servers + 'hrsh7th/cmp-nvim-lsp-signature-help', 'hrsh7th/cmp-nvim-lsp', -- add lsp to completion engine 'hrsh7th/cmp-buffer', -- add buffer information to completion engine 'hrsh7th/cmp-path', -- add filesystem information to complete enging @@ -115,6 +117,7 @@ packer.startup(function() }, sources = cmp.config.sources({ { name = 'nvim_lsp' }, + { name = 'nvim_lsp_signature_help' }, { name = 'luasnip' }, }, { { name = 'buffer' },