Working on lsp
This commit is contained in:
parent
764b890c58
commit
2566fbbec4
18 changed files with 293 additions and 110 deletions
19
lua/plugins_disabled/cmp.lua
Normal file
19
lua/plugins_disabled/cmp.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
{
|
||||
"hrsh7th/cmp-cmdline",
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-path",
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-buffer",
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
75
lua/plugins_disabled/lsp.lua
Normal file
75
lua/plugins_disabled/lsp.lua
Normal file
|
@ -0,0 +1,75 @@
|
|||
return {
|
||||
{
|
||||
-- Mason: install and manage LSP servers, DAP servers, linters, and formatters
|
||||
"williamboman/mason.nvim",
|
||||
build = ":MasonUpdate", -- :MasonUpdate updates registry contents
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = {
|
||||
-- Available servers: https://github.com/williamboman/mason-lspconfig.nvim#available-lsp-servers
|
||||
ensure_installed = {
|
||||
'lua_ls',
|
||||
'rust_analyzer',
|
||||
'tsserver',
|
||||
"eslint",
|
||||
'cssls',
|
||||
'cssmodules_ls',
|
||||
'pyright',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function(_, opts)
|
||||
local c = require 'lspconfig'
|
||||
local u = require "lspconfig/util"
|
||||
|
||||
c.lua_ls.setup {
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
|
||||
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
|
||||
[vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
c.rust_analyzer.setup {
|
||||
on_attach = function() end,
|
||||
capabilities = {},
|
||||
filetypes = { "rust" },
|
||||
root_dir = u.root_pattern("Cargo.toml"),
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
c.tsserver.setup {
|
||||
|
||||
}
|
||||
|
||||
c.eslint.setup {
|
||||
|
||||
}
|
||||
|
||||
c.cssls.setup {}
|
||||
|
||||
c.cssmodules_ls.setup {}
|
||||
|
||||
c.pyright.setup {}
|
||||
end
|
||||
},
|
||||
}
|
||||
|
3
lua/plugins_disabled/null-ls.lua
Normal file
3
lua/plugins_disabled/null-ls.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
}
|
20
lua/plugins_disabled/which-key.lua
Normal file
20
lua/plugins_disabled/which-key.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
commit = "e271c28118998c93a14d189af3395812a1aa646c", -- May 22, 2023
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
opts = {
|
||||
icons = { group = vim.g.icons_enabled and "" or "+", separator = "" },
|
||||
disable = { filetypes = { "TelescopePrompt" } },
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
setup = function(_, opts)
|
||||
require("which-key").setup(opts)
|
||||
require("keymaps").which_key_register()
|
||||
end
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue