add lsp-signature.nvim (#142)

This commit is contained in:
siduck76 2021-08-07 11:25:23 +05:30
parent 232bb5fd7c
commit d4193727bd
3 changed files with 38 additions and 5 deletions

View File

@ -112,9 +112,8 @@ fg("DashboardFooter", grey_fg)
-- packer's floating window -- packer's floating window
bg("NormalFloat", black2) bg("NormalFloat", "NONE")
bg("FloatBorder", black2) fg("FloatBorder", blue)
fg("FloatBorder", black2)
-- set bg color for nvim -- set bg color for nvim
-- bg("Normal", black) -- bg("Normal", black)

View File

@ -57,7 +57,7 @@ return packer.startup(
end end
} }
-- language related plugins -- lsp stuff
use { use {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
event = "BufRead", event = "BufRead",
@ -68,7 +68,7 @@ return packer.startup(
use { use {
"kabouzeid/nvim-lspinstall", "kabouzeid/nvim-lspinstall",
event = "BufEnter" event = "BufRead"
} }
use { use {
@ -87,6 +87,14 @@ return packer.startup(
end end
} }
use {
after = "nvim-lspconfig",
"ray-x/lsp_signature.nvim",
config = function()
require("plugins.others").signature()
end
}
-- load compe in insert mode only -- load compe in insert mode only
use { use {
"hrsh7th/nvim-compe", "hrsh7th/nvim-compe",

View File

@ -46,4 +46,30 @@ M.blankline = function()
vim.g.indent_blankline_show_first_indent_level = false vim.g.indent_blankline_show_first_indent_level = false
end 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 return M