Compare commits

...

10 Commits

13 changed files with 111 additions and 51 deletions

View File

@ -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")

View File

@ -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

View File

@ -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,
},
})

View File

@ -0,0 +1 @@
return { "RRethy/vim-illuminate" }

10
lua/plugins/surround.lua Normal file
View File

@ -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,
}

View File

@ -0,0 +1,3 @@
return {
"NLKNguyen/papercolor-theme",
}

View File

@ -0,0 +1 @@
return { "xiyaowong/transparent.nvim" }

55
lua/setup/lsp.lua Normal file
View File

@ -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,
})