From d4193727bd474d4454fa8fdec6764bf2064aaf5b Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 7 Aug 2021 11:25:23 +0530 Subject: [PATCH] add lsp-signature.nvim (#142) --- lua/highlights.lua | 5 ++--- lua/pluginList.lua | 12 ++++++++++-- lua/plugins/others.lua | 26 ++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/lua/highlights.lua b/lua/highlights.lua index b6f891d..44a6d5b 100644 --- a/lua/highlights.lua +++ b/lua/highlights.lua @@ -112,9 +112,8 @@ fg("DashboardFooter", grey_fg) -- packer's floating window -bg("NormalFloat", black2) -bg("FloatBorder", black2) -fg("FloatBorder", black2) +bg("NormalFloat", "NONE") +fg("FloatBorder", blue) -- set bg color for nvim -- bg("Normal", black) diff --git a/lua/pluginList.lua b/lua/pluginList.lua index cfac9e6..168d9d4 100644 --- a/lua/pluginList.lua +++ b/lua/pluginList.lua @@ -57,7 +57,7 @@ return packer.startup( end } - -- language related plugins + -- lsp stuff use { "nvim-treesitter/nvim-treesitter", event = "BufRead", @@ -68,7 +68,7 @@ return packer.startup( use { "kabouzeid/nvim-lspinstall", - event = "BufEnter" + event = "BufRead" } use { @@ -87,6 +87,14 @@ return packer.startup( end } + use { + after = "nvim-lspconfig", + "ray-x/lsp_signature.nvim", + config = function() + require("plugins.others").signature() + end + } + -- load compe in insert mode only use { "hrsh7th/nvim-compe", diff --git a/lua/plugins/others.lua b/lua/plugins/others.lua index 0a060a6..b3c1032 100644 --- a/lua/plugins/others.lua +++ b/lua/plugins/others.lua @@ -46,4 +46,30 @@ M.blankline = function() vim.g.indent_blankline_show_first_indent_level = false end +M.signature = function() + local present, lspsignature = pcall(require, "lsp_signature") + if present then + lspsignature.setup( + { + bind = true, + doc_lines = 2, + floating_window = true, + fix_pos = true, + hint_enable = true, + hint_prefix = " ", + hint_scheme = "String", + use_lspsaga = false, + hi_parameter = "Search", + max_height = 22, + max_width = 120, -- max_width of signature floating_window, line will be wrapped if exceed max_width + handler_opts = { + border = "single" -- double, single, shadow, none + }, + zindex = 200, -- by default it will be on top of all floating windows, set to 50 send it to bottom + padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc + } + ) + end +end + return M