7 files changed,
109 insertions(+),
20 deletions(-)
M
lua/plugin/configs/lsp/config.lua
@@ -28,6 +28,11 @@
require("nvim-lsp-installer").on_server_ready(function(server) local opts = { on_attach = on_attach } + local ok, user_opts = pcall(require, "plugin.configs.lsp.providers." .. server.name) + if ok then + opts = vim.tbl_deep_extend("force", opts, user_opts) + end + server:setup(opts) require("lspconfig")["null-ls"].setup {}
A
lua/plugin/configs/lsp/providers/jsonls.lua
@@ -0,0 +1,38 @@
+return { + settings = { + json = { + schemas = { + { + description = "TypeScript compiler configuration file", + url = "https://json.schemastore.org/tsconfig.json", + fileMatch = { "tsconfig.json", "tsconfig.*.json" }, + }, + { + description = "Lerna config", + url = "https://json.schemastore.org/lerna.json", + fileMatch = { "lerna.json" }, + }, + { + description = "ESLint config", + url = "https://json.schemastore.org/eslintrc.json", + fileMatch = { ".eslintrc.json", ".eslintrc" }, + }, + { + description = "Prettier config", + url = "https://json.schemastore.org/prettierrc", + fileMatch = { ".prettierrc", ".prettierrc.json", "prettier.config.json" }, + }, + { + description = "golangci-lint configuration file", + fileMatch = { ".golangci.toml", ".golangci.json" }, + url = "https://json.schemastore.org/golangci-lint.json", + }, + { + description = "NPM configuration file", + fileMatch = { "package.json" }, + url = "https://json.schemastore.org/package.json", + }, + }, + }, + }, +}
A
lua/plugin/configs/lsp/providers/rust_analyzer.lua
@@ -0,0 +1,12 @@
+return { + settings = { + ["rust-analyzer"] = { + assist = { + importGranularity = "module", + importPrefix = "by_self", + }, + cargo = { loadOutDirsFromCheck = true }, + procMacro = { enable = true }, + }, + }, +}
A
lua/plugin/configs/lsp/providers/sumneko_lua.lua
@@ -0,0 +1,12 @@
+return { + settings = { + Lua = { + diagnostics = { globals = { "vim" } }, + workspace = { + library = { [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true, [vim.fn.expand "$VIMRUNTIME/lua"] = true }, + maxPreload = 100000, + preloadFileSize = 10000, + }, + }, + }, +}
A
lua/plugin/configs/lsp/providers/yamlls.lua
@@ -0,0 +1,14 @@
+return { + settings = { + yaml = { + hover = true, + completion = true, + validate = true, + schemaStore = { + enable = true, + url = "https://www.schemastore.org/api/json/catalog.json", + }, + schemas = {}, + }, + }, +}
M
lua/plugin/configs/telescope.lua
@@ -20,7 +20,10 @@ horizontal = { mirror = false },
vertical = { mirror = false }, }, vimgrep_arguments = { - "fd", "--colors=never", "--type files" + "fd", + "--colors=never", + "--type", + "files", }, file_ignore_patterns = { ".git", "node_modules", "target", "env", ".bin" }, path_display = { shorten = 5 },
M
lua/plugin/init.lua
@@ -23,24 +23,33 @@ }
use { "neovim/nvim-lspconfig", - requires = "williamboman/nvim-lsp-installer", + requires = { + "williamboman/nvim-lsp-installer", + { + "jose-elias-alvarez/null-ls.nvim", + after = "nvim-lspconfig", + config = function() + require("plugin.configs.lsp.null-ls").setup() + end, + }, + }, config = function() require("plugin.configs.lsp.config").setup() end, } use { - "jose-elias-alvarez/null-ls.nvim", - after = "nvim-lspconfig", + "windwp/nvim-autopairs", config = function() - require("plugin.configs.lsp.null-ls").setup() + require("nvim-autopairs").setup {} end, } use { - "windwp/nvim-autopairs", + "ray-x/go.nvim", + ft = "go", config = function() - require("nvim-autopairs").setup {} + require("go").setup { gofmt = "gofumpt" } end, }@@ -60,7 +69,6 @@ }
use { "nvim-lualine/lualine.nvim", - config = function() require("plugin.configs.statusline").setup() end,@@ -89,11 +97,7 @@ requires = {
{ "hrsh7th/cmp-nvim-lua", after = "nvim-cmp" }, { "hrsh7th/cmp-nvim-lsp", after = "nvim-cmp" }, { "hrsh7th/cmp-buffer", after = "nvim-cmp" }, - { - "saadparwaiz1/cmp_luasnip", - requires = { "L3MON4D3/LuaSnip", "rafamadriz/friendly-snippets" }, - after = "nvim-cmp", - }, + { "saadparwaiz1/cmp_luasnip", requires = { "L3MON4D3/LuaSnip", "rafamadriz/friendly-snippets" }, after = "nvim-cmp" }, }, config = function() require("plugin.configs.cmp").setup()@@ -126,15 +130,16 @@
use { "nvim-treesitter/nvim-treesitter", branch = "0.5-compat", - requires = { - "Smirnov-O/ts-unit.nvim", - after = "nvim-treesitter", - config = function() - require("ts-unit").setup { keymaps = true } - end, - }, config = function() require("plugin.configs.treesitter").setup() + end, + } + + use { + "Smirnov-O/ts-unit.nvim", + after = "nvim-treesitter", + config = function() + require("ts-unit").setup { keymaps = true } end, }