[nvim] which-key plugin added, pyright fixed
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
"github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" },
|
"github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
||||||
@@ -9,5 +11,6 @@
|
|||||||
"nvim-lspconfig": { "branch": "master", "commit": "fd26f8626c03b424f7140d454031d1dcb8d23513" },
|
"nvim-lspconfig": { "branch": "master", "commit": "fd26f8626c03b424f7140d454031d1dcb8d23513" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" },
|
"telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "814f102cd1da3dc78c7d2f20f2ef3ed3cdf0e6e4" }
|
"telescope.nvim": { "branch": "master", "commit": "814f102cd1da3dc78c7d2f20f2ef3ed3cdf0e6e4" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ require("mason-lspconfig").setup({
|
|||||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||||
--
|
--
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, opts)
|
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, opts)
|
||||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
|
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
|
||||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
|
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
|
||||||
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, opts)
|
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, opts)
|
||||||
|
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
-- Enable completion triggered by <c-x><c-o>
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
@@ -33,17 +33,17 @@ local on_attach = function(client, bufnr)
|
|||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
|
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
|
||||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, bufopts)
|
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, bufopts)
|
||||||
|
vim.keymap.set("n", "gr", vim.lsp.buf.references, bufopts)
|
||||||
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, bufopts)
|
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, bufopts)
|
||||||
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, bufopts)
|
vim.keymap.set("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, bufopts)
|
||||||
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
|
vim.keymap.set("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||||
vim.keymap.set("n", "<space>wl", function()
|
vim.keymap.set("n", "<leader>wl", function()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
end, bufopts)
|
end, bufopts)
|
||||||
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, bufopts)
|
vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, bufopts)
|
||||||
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, bufopts)
|
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, bufopts)
|
||||||
vim.keymap.set("n", "<space>ca", vim.lsp.buf.code_action, bufopts)
|
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, bufopts)
|
||||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, bufopts)
|
vim.keymap.set("n", "<leader>lf", function()
|
||||||
vim.keymap.set("n", "<space>lf", function()
|
|
||||||
vim.lsp.buf.format({
|
vim.lsp.buf.format({
|
||||||
async = true,
|
async = true,
|
||||||
})
|
})
|
||||||
@@ -102,12 +102,27 @@ require("lspconfig").lua_ls.setup({
|
|||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
handlers = handlers
|
handlers = handlers
|
||||||
})
|
})
|
||||||
require("lspconfig").gopls.setup {capabilities = capabilities, handlers = handlers}
|
require("lspconfig").gopls.setup { capabilities = capabilities, handlers = handlers, on_attach = on_attach}
|
||||||
require("lspconfig").bashls.setup {capabilities = capabilities, handlers = handlers,
|
require("lspconfig").bashls.setup { capabilities = capabilities, handlers = handlers,
|
||||||
|
on_attach = on_attach,
|
||||||
settings = {
|
settings = {
|
||||||
bashIde = {
|
bashIde = {
|
||||||
globPattern = "*@(.sh|.inc|.bash|.command)"
|
globPattern = "*@(.sh|.inc|.bash|.command)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
require'lspconfig'.pyright.setup{}
|
require("lspconfig").pyright.setup { capabilities = capabilities, handlers = handlers,
|
||||||
|
on_attach = on_attach,
|
||||||
|
settings = {
|
||||||
|
python = {
|
||||||
|
analysis = {
|
||||||
|
include = {
|
||||||
|
'~/arcadia',
|
||||||
|
'~/arcadia/yt/python',
|
||||||
|
'~/arcadia/contrib/libs/protobuf/python',
|
||||||
|
'~/arcadia/contrib/python',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -38,13 +38,33 @@ local plugins = {
|
|||||||
"nvim-telescope/telescope-file-browser.nvim",
|
"nvim-telescope/telescope-file-browser.nvim",
|
||||||
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }
|
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }
|
||||||
},
|
},
|
||||||
'hrsh7th/nvim-cmp', -- Auto-completion plugin
|
{
|
||||||
dependencies = {
|
'hrsh7th/nvim-cmp', -- Auto-completion plugin
|
||||||
'hrsh7th/cmp-nvim-lsp', -- LSP source for nvim-cmp
|
dependencies = {
|
||||||
'hrsh7th/cmp-buffer', -- Buffer source for nvim-cmp
|
'hrsh7th/cmp-nvim-lsp', -- LSP source for nvim-cmp
|
||||||
'hrsh7th/cmp-path', -- Path source for nvim-cmp
|
'hrsh7th/cmp-buffer', -- Buffer source for nvim-cmp
|
||||||
|
'hrsh7th/cmp-path', -- Path source for nvim-cmp
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
'L3MON4D3/LuaSnip',
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
|
-- your configuration comes here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
-- refer to the configuration section below
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>?",
|
||||||
|
function()
|
||||||
|
require("which-key").show({ global = false })
|
||||||
|
end,
|
||||||
|
desc = "Buffer Local Keymaps (which-key)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
require("lazy").setup(plugins)
|
require("lazy").setup(plugins)
|
||||||
|
|||||||
Reference in New Issue
Block a user