|
@@ -91,8 +91,8 @@ lvim.builtin.treesitter.highlight.enabled = true
|
|
-- local opts = {} -- check the lspconfig documentation for a list of all possible options
|
|
-- local opts = {} -- check the lspconfig documentation for a list of all possible options
|
|
-- require("lvim.lsp.manager").setup("pylsp", opts)
|
|
-- require("lvim.lsp.manager").setup("pylsp", opts)
|
|
|
|
|
|
--- you can set a custom on_attach function that will be used for all the language servers
|
|
|
|
--- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
|
|
|
|
|
|
+-- -- you can set a custom on_attach function that will be used for all the language servers
|
|
|
|
+-- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
|
|
-- lvim.lsp.on_attach_callback = function(client, bufnr)
|
|
-- lvim.lsp.on_attach_callback = function(client, bufnr)
|
|
-- local function buf_set_option(...)
|
|
-- local function buf_set_option(...)
|
|
-- vim.api.nvim_buf_set_option(bufnr, ...)
|
|
-- vim.api.nvim_buf_set_option(bufnr, ...)
|
|
@@ -100,30 +100,18 @@ lvim.builtin.treesitter.highlight.enabled = true
|
|
-- --Enable completion triggered by <c-x><c-o>
|
|
-- --Enable completion triggered by <c-x><c-o>
|
|
-- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
|
-- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
|
-- end
|
|
-- end
|
|
--- you can overwrite the null_ls setup table (useful for setting the root_dir function)
|
|
|
|
--- lvim.lsp.null_ls.setup.root_dir = require("lspconfig").util.root_pattern("Makefile", ".git", "node_modules")
|
|
|
|
--- or if you need something more advanced
|
|
|
|
--- lvim.lsp.null_ls.setup.root_dir = function(fname)
|
|
|
|
--- if vim.bo.filetype == "javascript" then
|
|
|
|
--- return require("lspconfig/util").root_pattern("Makefile", ".git", "node_modules")(fname)
|
|
|
|
--- or require("lspconfig/util").path.dirname(fname)
|
|
|
|
--- elseif vim.bo.filetype == "php" then
|
|
|
|
--- return require("lspconfig/util").root_pattern("Makefile", ".git", "composer.json")(fname) or vim.fn.getcwd()
|
|
|
|
--- else
|
|
|
|
--- return require("lspconfig/util").root_pattern("Makefile", ".git")(fname) or require("lspconfig/util").path.dirname(fname)
|
|
|
|
--- end
|
|
|
|
--- end
|
|
|
|
|
|
|
|
-- -- set a formatter, this will override the language server formatting capabilities (if it exists)
|
|
-- -- set a formatter, this will override the language server formatting capabilities (if it exists)
|
|
-- local formatters = require "lvim.lsp.null-ls.formatters"
|
|
-- local formatters = require "lvim.lsp.null-ls.formatters"
|
|
-- formatters.setup {
|
|
-- formatters.setup {
|
|
--- { exe = "black", filetypes = { "python" } },
|
|
|
|
--- { exe = "isort", filetypes = { "python" } },
|
|
|
|
|
|
+-- { command = "black", filetypes = { "python" } },
|
|
|
|
+-- { command = "isort", filetypes = { "python" } },
|
|
-- {
|
|
-- {
|
|
--- exe = "prettier",
|
|
|
|
|
|
+-- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
|
|
|
|
+-- command = "prettier",
|
|
-- ---@usage arguments to pass to the formatter
|
|
-- ---@usage arguments to pass to the formatter
|
|
-- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
|
|
-- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
|
|
--- args = { "--print-with", "100" },
|
|
|
|
|
|
+-- extra_args = { "--print-with", "100" },
|
|
-- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
|
|
-- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
|
|
-- filetypes = { "typescript", "typescriptreact" },
|
|
-- filetypes = { "typescript", "typescriptreact" },
|
|
-- },
|
|
-- },
|
|
@@ -132,15 +120,16 @@ lvim.builtin.treesitter.highlight.enabled = true
|
|
-- -- set additional linters
|
|
-- -- set additional linters
|
|
-- local linters = require "lvim.lsp.null-ls.linters"
|
|
-- local linters = require "lvim.lsp.null-ls.linters"
|
|
-- linters.setup {
|
|
-- linters.setup {
|
|
--- { exe = "flake8", filetypes = { "python" } },
|
|
|
|
|
|
+-- { command = "flake8", filetypes = { "python" } },
|
|
-- {
|
|
-- {
|
|
--- exe = "shellcheck",
|
|
|
|
|
|
+-- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
|
|
|
|
+-- command = "shellcheck",
|
|
-- ---@usage arguments to pass to the formatter
|
|
-- ---@usage arguments to pass to the formatter
|
|
-- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
|
|
-- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
|
|
--- args = { "--severity", "warning" },
|
|
|
|
|
|
+-- extra_args = { "--severity", "warning" },
|
|
-- },
|
|
-- },
|
|
-- {
|
|
-- {
|
|
--- exe = "codespell",
|
|
|
|
|
|
+-- command = "codespell",
|
|
-- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
|
|
-- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
|
|
-- filetypes = { "javascript", "python" },
|
|
-- filetypes = { "javascript", "python" },
|
|
-- },
|
|
-- },
|