Compare commits
10 Commits
b5983a8f4b
...
bbcc388705
Author | SHA1 | Date |
---|---|---|
|
bbcc388705 | |
|
0ccdf18a7c | |
|
7e43002a31 | |
|
a21e80feea | |
|
cef5c6502e | |
|
5f6f684014 | |
|
4422fea896 | |
|
aa6d9b284f | |
|
ab1682da18 | |
|
adc127a8c1 |
2
init.lua
2
init.lua
|
@ -14,5 +14,5 @@ end
|
|||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({ { import = "plugins" }, { import = "plugins.lsp" }, { import = "plugins.themes" } })
|
||||
require("lsp_setup")
|
||||
require("setup.lsp")
|
||||
vim.cmd("colorscheme rose-pine")
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
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
|
|
@ -1,50 +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" --[[ "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,
|
||||
},
|
||||
})
|
|
@ -0,0 +1 @@
|
|||
return { "RRethy/vim-illuminate" }
|
|
@ -0,0 +1,10 @@
|
|||
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,
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"NLKNguyen/papercolor-theme",
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
return { "xiyaowong/transparent.nvim" }
|
|
@ -0,0 +1,55 @@
|
|||
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