Compare commits
No commits in common. "bbcc388705a74d0b6c35863783c12d8286984b72" and "b5983a8f4bc98ea5969daf1e67ccb43678af1a63" have entirely different histories.
bbcc388705
...
b5983a8f4b
2
init.lua
2
init.lua
|
@ -14,5 +14,5 @@ end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
require("lazy").setup({ { import = "plugins" }, { import = "plugins.lsp" }, { import = "plugins.themes" } })
|
require("lazy").setup({ { import = "plugins" }, { import = "plugins.lsp" }, { import = "plugins.themes" } })
|
||||||
require("setup.lsp")
|
require("lsp_setup")
|
||||||
vim.cmd("colorscheme rose-pine")
|
vim.cmd("colorscheme rose-pine")
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
local M = {}
|
|
||||||
|
|
||||||
local on_attach = function(client, bufnr)
|
|
||||||
client.server_capabilities.documentFormattingProvider = true
|
|
||||||
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
|
||||||
|
|
||||||
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
|
||||||
end
|
|
||||||
|
|
||||||
M.on_attach = on_attach;
|
|
||||||
|
|
||||||
M.settings = {
|
|
||||||
codeAction = {
|
|
||||||
disableRuleComment = {
|
|
||||||
enable = true,
|
|
||||||
location = "separateLine"
|
|
||||||
},
|
|
||||||
showDocumentation = {
|
|
||||||
enable = true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
codeActionOnSave = {
|
|
||||||
enable = false,
|
|
||||||
mode = "all"
|
|
||||||
},
|
|
||||||
format = true,
|
|
||||||
nodePath = "",
|
|
||||||
onIgnoredFiles = "off",
|
|
||||||
packageManager = "npm",
|
|
||||||
quiet = false,
|
|
||||||
rulesCustomizations = {},
|
|
||||||
run = "onType",
|
|
||||||
useESLintClass = false,
|
|
||||||
validate = "on",
|
|
||||||
workingDirectory = {
|
|
||||||
mode = "location"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return M
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
local default_setup = function(server)
|
||||||
|
require("lspconfig")[server].setup({
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- enable mason and configure icons
|
||||||
|
require("mason").setup({
|
||||||
|
ui = {
|
||||||
|
icons = {
|
||||||
|
package_installed = "✓",
|
||||||
|
package_pending = "➜",
|
||||||
|
package_uninstalled = "✗",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
require("mason-lspconfig").setup({
|
||||||
|
ensure_installed = {
|
||||||
|
"tsserver",
|
||||||
|
"cssls",
|
||||||
|
"html",
|
||||||
|
"bashls" --[[ "marksman", ]]
|
||||||
|
},
|
||||||
|
handlers = {
|
||||||
|
default_setup,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local cmp = require("cmp")
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
-- Enter key confirms completion item
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||||
|
|
||||||
|
-- Ctrl + space triggers completion menu
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
}),
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require("luasnip").lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
|
@ -1 +0,0 @@
|
||||||
return { "RRethy/vim-illuminate" }
|
|
|
@ -1,10 +0,0 @@
|
||||||
return {
|
|
||||||
"kylechui/nvim-surround",
|
|
||||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
|
||||||
event = "VeryLazy",
|
|
||||||
config = function()
|
|
||||||
require("nvim-surround").setup({
|
|
||||||
-- Configuration here, or leave empty to use defaults
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
return {
|
|
||||||
"NLKNguyen/papercolor-theme",
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
return { "xiyaowong/transparent.nvim" }
|
|
|
@ -1,55 +0,0 @@
|
||||||
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()
|
|
||||||
|
|
||||||
local default_setup = function(server)
|
|
||||||
require("lspconfig")[server].setup({
|
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- enable mason and configure icons
|
|
||||||
require("mason").setup({
|
|
||||||
ui = {
|
|
||||||
icons = {
|
|
||||||
package_installed = "✓",
|
|
||||||
package_pending = "➜",
|
|
||||||
package_uninstalled = "✗",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
require("mason-lspconfig").setup({
|
|
||||||
ensure_installed = {
|
|
||||||
"tsserver",
|
|
||||||
"cssls",
|
|
||||||
"html",
|
|
||||||
"bashls",
|
|
||||||
"eslint",
|
|
||||||
"marksman",
|
|
||||||
},
|
|
||||||
handlers = {
|
|
||||||
default_setup,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
|
|
||||||
require("mason-lspconfig").setup_handlers({
|
|
||||||
-- The first entry (without a key) will be the default handler
|
|
||||||
-- and will be called for each installed server that doesn't have
|
|
||||||
-- a dedicated handler.
|
|
||||||
function(server_name)
|
|
||||||
require("lspconfig")[server_name].setup({
|
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
--handlers = handlers,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
["eslint"] = function()
|
|
||||||
lspconfig.eslint.setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
--handlers = handlers,
|
|
||||||
on_attach = require("config.lsp.servers.eslint").on_attach,
|
|
||||||
settings = require("config.lsp.servers.eslint").settings,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue