added lsp_signature
This commit is contained in:
parent
a4164204a7
commit
b655d82f15
@ -1,7 +1,11 @@
|
|||||||
require 'andr3.lsp_adds.prettier'
|
require 'andr3.lsp_adds.prettier'
|
||||||
require 'andr3.lsp_adds.null-ls'
|
require 'andr3.lsp_adds.null-ls'
|
||||||
|
|
||||||
-- Items
|
-- Signature
|
||||||
|
|
||||||
|
require 'lsp_signature'.setup({ });
|
||||||
|
|
||||||
|
-- Items {{{
|
||||||
require('vim.lsp.protocol').CompletionItemKind = {
|
require('vim.lsp.protocol').CompletionItemKind = {
|
||||||
'', -- Text
|
'', -- Text
|
||||||
'', -- Method
|
'', -- Method
|
||||||
@ -29,8 +33,34 @@ require('vim.lsp.protocol').CompletionItemKind = {
|
|||||||
'', -- Operator
|
'', -- Operator
|
||||||
'', -- TypeParameter
|
'', -- TypeParameter
|
||||||
}
|
}
|
||||||
|
--- }}}
|
||||||
|
|
||||||
vim.diagnostic.config({ virtual_text = { prefix = '🅰', } })
|
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||||
|
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||||
|
-- Enable underline, use default values
|
||||||
|
underline = true,
|
||||||
|
-- Enable virtual text, override spacing to 4
|
||||||
|
virtual_text = {
|
||||||
|
spacing = 4,
|
||||||
|
prefix = '~',
|
||||||
|
},
|
||||||
|
-- Use a function to dynamically turn signs off
|
||||||
|
-- and on, using buffer local variables
|
||||||
|
signs = function(bufnr, client_id)
|
||||||
|
local ok, result = pcall(vim.api.nvim_buf_get_var, bufnr, 'show_signs')
|
||||||
|
-- No buffer local variable set, so just enable by default
|
||||||
|
if not ok then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
return result
|
||||||
|
end,
|
||||||
|
-- Disable a feature
|
||||||
|
update_in_insert = false,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
-- vim.diagnostic.config({ virtual_text = { prefix = '🅰', } })
|
||||||
|
|
||||||
local warn = "😞";
|
local warn = "😞";
|
||||||
local signs = { Error = "☣️ ", Warn = warn, Hint = "❤️ ", Info = "🆓" }
|
local signs = { Error = "☣️ ", Warn = warn, Hint = "❤️ ", Info = "🆓" }
|
||||||
@ -151,8 +181,9 @@ keymap("n", "<leader>sf", "<cmd>Lspsaga lsp_finder<CR>", { silent = true })
|
|||||||
keymap({"n","v"}, "<leader>ca", function () saga.code_action() end, {})
|
keymap({"n","v"}, "<leader>ca", function () saga.code_action() end, {})
|
||||||
keymap("n", "gr", "<cmd>Lspsaga rename<CR>", { silent = true })
|
keymap("n", "gr", "<cmd>Lspsaga rename<CR>", { silent = true })
|
||||||
keymap("n", "gd", "<cmd>Lspsaga peek_definition<CR>", { silent = true })
|
keymap("n", "gd", "<cmd>Lspsaga peek_definition<CR>", { silent = true })
|
||||||
keymap("n", "<leader>cd", "<cmd>Lspsaga show_line_diagnostics<CR>", { silent = true })
|
--keymap("n", "<leader>cd", "<cmd>Lspsaga show_line_diagnostics<CR>", { silent = true })
|
||||||
keymap("n", "<leader>cd", "<cmd>Lspsaga show_cursor_diagnostics<CR>", { silent = true })
|
keymap("n", "<leader>cd", "<cmd>Lspsaga show_cursor_diagnostics<CR>", { silent = true })
|
||||||
|
keymap('n', '<space>e', '<cmd>lua vim.diagnostic.open_float()<CR>', { silent = true })
|
||||||
keymap("n", "[e", "<cmd>Lspsaga diagnostic_jump_prev<CR>", { silent = true })
|
keymap("n", "[e", "<cmd>Lspsaga diagnostic_jump_prev<CR>", { silent = true })
|
||||||
keymap("n", "]e", "<cmd>Lspsaga diagnostic_jump_next<CR>", { silent = true })
|
keymap("n", "]e", "<cmd>Lspsaga diagnostic_jump_next<CR>", { silent = true })
|
||||||
|
|
||||||
@ -250,6 +281,13 @@ vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
|||||||
-- after the language server attaches to the current buffer
|
-- after the language server attaches to the current buffer
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
|
|
||||||
|
require "lsp_signature".on_attach({
|
||||||
|
bind = true,
|
||||||
|
handler_opts = {
|
||||||
|
border = "rounded"
|
||||||
|
}
|
||||||
|
}, bufnr)
|
||||||
|
|
||||||
-- Enable completion triggered by <c-x><c-o>
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ return require('packer').startup(function()
|
|||||||
-- other stuff
|
-- other stuff
|
||||||
|
|
||||||
use 'neovim/nvim-lspconfig'
|
use 'neovim/nvim-lspconfig'
|
||||||
|
use 'ray-x/lsp_signature.nvim'
|
||||||
|
|
||||||
use 'jose-elias-alvarez/null-ls.nvim'
|
use 'jose-elias-alvarez/null-ls.nvim'
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@ local function save_profiles(threshold)
|
|||||||
end
|
end
|
||||||
|
|
||||||
time([[Luarocks path setup]], true)
|
time([[Luarocks path setup]], true)
|
||||||
local package_path_str = "/Users/AHS40/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/AHS40/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/AHS40/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/AHS40/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
|
local package_path_str = "/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
|
||||||
local install_cpath_pattern = "/Users/AHS40/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
|
local install_cpath_pattern = "/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
|
||||||
if not string.find(package.path, package_path_str, 1, true) then
|
if not string.find(package.path, package_path_str, 1, true) then
|
||||||
package.path = package.path .. ';' .. package_path_str
|
package.path = package.path .. ';' .. package_path_str
|
||||||
end
|
end
|
||||||
@ -76,157 +76,162 @@ time([[Defining packer_plugins]], true)
|
|||||||
_G.packer_plugins = {
|
_G.packer_plugins = {
|
||||||
["ayu-vim"] = {
|
["ayu-vim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/ayu-vim",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/ayu-vim",
|
||||||
url = "https://github.com/ayu-theme/ayu-vim"
|
url = "https://github.com/ayu-theme/ayu-vim"
|
||||||
},
|
},
|
||||||
catppuccin = {
|
catppuccin = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/catppuccin",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/catppuccin",
|
||||||
url = "https://github.com/catppuccin/nvim"
|
url = "https://github.com/catppuccin/nvim"
|
||||||
},
|
},
|
||||||
["cmp-buffer"] = {
|
["cmp-buffer"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/cmp-buffer",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/cmp-buffer",
|
||||||
url = "https://github.com/hrsh7th/cmp-buffer"
|
url = "https://github.com/hrsh7th/cmp-buffer"
|
||||||
},
|
},
|
||||||
["cmp-cmdline"] = {
|
["cmp-cmdline"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/cmp-cmdline",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/cmp-cmdline",
|
||||||
url = "https://github.com/hrsh7th/cmp-cmdline"
|
url = "https://github.com/hrsh7th/cmp-cmdline"
|
||||||
},
|
},
|
||||||
["cmp-nvim-lsp"] = {
|
["cmp-nvim-lsp"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
|
||||||
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
|
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||||
},
|
},
|
||||||
["cmp-path"] = {
|
["cmp-path"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/cmp-path",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/cmp-path",
|
||||||
url = "https://github.com/hrsh7th/cmp-path"
|
url = "https://github.com/hrsh7th/cmp-path"
|
||||||
},
|
},
|
||||||
["eva01.vim"] = {
|
["eva01.vim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/eva01.vim",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/eva01.vim",
|
||||||
url = "https://github.com/hachy/eva01.vim"
|
url = "https://github.com/hachy/eva01.vim"
|
||||||
},
|
},
|
||||||
["html5.vim"] = {
|
["html5.vim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/html5.vim",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/html5.vim",
|
||||||
url = "https://github.com/othree/html5.vim"
|
url = "https://github.com/othree/html5.vim"
|
||||||
},
|
},
|
||||||
|
["lsp_signature.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/lsp_signature.nvim",
|
||||||
|
url = "https://github.com/ray-x/lsp_signature.nvim"
|
||||||
|
},
|
||||||
["lspkind.nvim"] = {
|
["lspkind.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/lspkind.nvim",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/lspkind.nvim",
|
||||||
url = "https://github.com/onsails/lspkind.nvim"
|
url = "https://github.com/onsails/lspkind.nvim"
|
||||||
},
|
},
|
||||||
["lspsaga.nvim"] = {
|
["lspsaga.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/lspsaga.nvim",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/lspsaga.nvim",
|
||||||
url = "https://github.com/glepnir/lspsaga.nvim"
|
url = "https://github.com/glepnir/lspsaga.nvim"
|
||||||
},
|
},
|
||||||
["night_owl_light.vim"] = {
|
["night_owl_light.vim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/night_owl_light.vim",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/night_owl_light.vim",
|
||||||
url = "https://github.com/macguirerintoul/night_owl_light.vim"
|
url = "https://github.com/macguirerintoul/night_owl_light.vim"
|
||||||
},
|
},
|
||||||
["null-ls.nvim"] = {
|
["null-ls.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
|
||||||
url = "https://github.com/jose-elias-alvarez/null-ls.nvim"
|
url = "https://github.com/jose-elias-alvarez/null-ls.nvim"
|
||||||
},
|
},
|
||||||
["nvim-cmp"] = {
|
["nvim-cmp"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
||||||
url = "https://github.com/hrsh7th/nvim-cmp"
|
url = "https://github.com/hrsh7th/nvim-cmp"
|
||||||
},
|
},
|
||||||
["nvim-lspconfig"] = {
|
["nvim-lspconfig"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||||
url = "https://github.com/neovim/nvim-lspconfig"
|
url = "https://github.com/neovim/nvim-lspconfig"
|
||||||
},
|
},
|
||||||
["nvim-tree.lua"] = {
|
["nvim-tree.lua"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
|
||||||
url = "https://github.com/nvim-tree/nvim-tree.lua"
|
url = "https://github.com/nvim-tree/nvim-tree.lua"
|
||||||
},
|
},
|
||||||
["nvim-treesitter"] = {
|
["nvim-treesitter"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||||
},
|
},
|
||||||
["nvim-web-devicons"] = {
|
["nvim-web-devicons"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
||||||
url = "https://github.com/nvim-tree/nvim-web-devicons"
|
url = "https://github.com/nvim-tree/nvim-web-devicons"
|
||||||
},
|
},
|
||||||
["packer.nvim"] = {
|
["packer.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||||
url = "https://github.com/wbthomason/packer.nvim"
|
url = "https://github.com/wbthomason/packer.nvim"
|
||||||
},
|
},
|
||||||
["plenary.nvim"] = {
|
["plenary.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/plenary.nvim",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/plenary.nvim",
|
||||||
url = "https://github.com/nvim-lua/plenary.nvim"
|
url = "https://github.com/nvim-lua/plenary.nvim"
|
||||||
},
|
},
|
||||||
["prettier.nvim"] = {
|
["prettier.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/prettier.nvim",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/prettier.nvim",
|
||||||
url = "https://github.com/MunifTanjim/prettier.nvim"
|
url = "https://github.com/MunifTanjim/prettier.nvim"
|
||||||
},
|
},
|
||||||
["telescope.nvim"] = {
|
["telescope.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
||||||
url = "https://github.com/nvim-telescope/telescope.nvim"
|
url = "https://github.com/nvim-telescope/telescope.nvim"
|
||||||
},
|
},
|
||||||
undotree = {
|
undotree = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/undotree",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/undotree",
|
||||||
url = "https://github.com/mbbill/undotree"
|
url = "https://github.com/mbbill/undotree"
|
||||||
},
|
},
|
||||||
["vim-airline"] = {
|
["vim-airline"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-airline",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-airline",
|
||||||
url = "https://github.com/vim-airline/vim-airline"
|
url = "https://github.com/vim-airline/vim-airline"
|
||||||
},
|
},
|
||||||
["vim-airline-themes"] = {
|
["vim-airline-themes"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-airline-themes",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-airline-themes",
|
||||||
url = "https://github.com/vim-airline/vim-airline-themes"
|
url = "https://github.com/vim-airline/vim-airline-themes"
|
||||||
},
|
},
|
||||||
["vim-commentary"] = {
|
["vim-commentary"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-commentary",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-commentary",
|
||||||
url = "https://github.com/chrisbra/vim-commentary"
|
url = "https://github.com/chrisbra/vim-commentary"
|
||||||
},
|
},
|
||||||
["vim-cyberpunk"] = {
|
["vim-cyberpunk"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-cyberpunk",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-cyberpunk",
|
||||||
url = "https://github.com/thedenisnikulin/vim-cyberpunk"
|
url = "https://github.com/thedenisnikulin/vim-cyberpunk"
|
||||||
},
|
},
|
||||||
["vim-gitgutter"] = {
|
["vim-gitgutter"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-gitgutter",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-gitgutter",
|
||||||
url = "https://github.com/airblade/vim-gitgutter"
|
url = "https://github.com/airblade/vim-gitgutter"
|
||||||
},
|
},
|
||||||
["vim-javascript"] = {
|
["vim-javascript"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-javascript",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-javascript",
|
||||||
url = "https://github.com/pangloss/vim-javascript"
|
url = "https://github.com/pangloss/vim-javascript"
|
||||||
},
|
},
|
||||||
["vim-svelte"] = {
|
["vim-svelte"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-svelte",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-svelte",
|
||||||
url = "https://github.com/evanleck/vim-svelte"
|
url = "https://github.com/evanleck/vim-svelte"
|
||||||
},
|
},
|
||||||
["vim-visual-multi"] = {
|
["vim-visual-multi"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-visual-multi",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-visual-multi",
|
||||||
url = "https://github.com/mg979/vim-visual-multi"
|
url = "https://github.com/mg979/vim-visual-multi"
|
||||||
},
|
},
|
||||||
["vim-vsnip"] = {
|
["vim-vsnip"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-vsnip",
|
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-vsnip",
|
||||||
url = "https://github.com/hrsh7th/vim-vsnip"
|
url = "https://github.com/hrsh7th/vim-vsnip"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user