]> git.localhorst.tv Git - nvim-config.git/commitdiff
refactor!: use new `opts` property
authorFolke Lemaitre <folke.lemaitre@gmail.com>
Sun, 8 Jan 2023 14:07:07 +0000 (15:07 +0100)
committerFolke Lemaitre <folke.lemaitre@gmail.com>
Sun, 8 Jan 2023 14:07:07 +0000 (15:07 +0100)
lua/plugins/editor.lua
lua/plugins/lsp.lua
lua/plugins/treesitter.lua

index ac60690f3da1f66e560e36254c904aefc7bf232d..df46fd063cf3598785a00f1872b52cfc7fa6f1a0 100644 (file)
@@ -8,7 +8,7 @@ return {
   -- change trouble config
   -- {
   --   "folke/trouble.nvim",
-  --   config = { use_diagnostic_signs = true },
+  --   opts = { use_diagnostic_signs = true },
   -- },
 
   -- add symbols-outline
index 6a7506b6e284eba9a6bc81e893bc9b2410182e1c..342d40875b77726e2be6ae0d2a5c4cf8d0507253 100644 (file)
@@ -3,39 +3,49 @@ return {
   -- uncomment and add lsp servers with their config to servers below
   {
     "neovim/nvim-lspconfig",
-    -- you can do any additional lsp server setup here
-    -- return true if you don't want this server to be setup with lspconfig
-    ---@param server string lsp server name
-    ---@param opts _.lspconfig.options any options set for the server
-    -- setup_server = function(server, opts)
-    --   return false
-    -- end,
-    ---@type lspconfig.options
-    -- servers = {
-    --   jsonls = {},
-    --   sumneko_lua = {
-    --     settings = {
-    --       Lua = {
-    --         workspace = {
-    --           checkThirdParty = false,
-    --         },
-    --         completion = {
-    --           callSnippet = "Replace",
+    -- ---@class PluginLspOpts
+    -- opts = {
+    --   ---@type lspconfig.options
+    --   servers = {
+    --     jsonls = {},
+    --     sumneko_lua = {
+    --       settings = {
+    --         Lua = {
+    --           workspace = {
+    --             checkThirdParty = false,
+    --           },
+    --           completion = {
+    --             callSnippet = "Replace",
+    --           },
     --         },
     --       },
     --     },
     --   },
+    --   -- you can do any additional lsp server setup here
+    --   -- return true if you don't want this server to be setup with lspconfig
+    --   ---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
+    --   setup = {
+    --     -- example to setup with typescript.nvim
+    --     -- tsserver = function(_, opts)
+    --     --   require("typescript").setup({ server = opts })
+    --     --   return true
+    --     -- end,
+    --     -- Specify * to use this function as a fallback for any server
+    --     -- ["*"] = function(server, opts) end,
+    --   },
     -- },
   },
 
   -- uncomment and add tools to ensure_installed below
   {
     "williamboman/mason.nvim",
-    -- ensure_installed = {
-    --   "stylua",
-    --   "shellcheck",
-    --   "shfmt",
-    --   "flake8",
+    -- opts = {
+    --   ensure_installed = {
+    --     "stylua",
+    --     "shellcheck",
+    --     "shfmt",
+    --     "flake8",
+    --   },
     -- },
   },
 }
index 679733895391931af21d229bc7c3f073bfa03c24..38279cafffd0d56432404b44db0fa82617817186 100644 (file)
@@ -3,22 +3,24 @@ return {
   -- treesitter
   {
     "nvim-treesitter/nvim-treesitter",
-    ensure_installed = {
-      "bash",
-      "help",
-      "html",
-      "javascript",
-      "json",
-      "lua",
-      "markdown",
-      "markdown_inline",
-      "python",
-      "query",
-      "regex",
-      "tsx",
-      "typescript",
-      "vim",
-      "yaml",
-    },
+    -- opts = {
+    --   ensure_installed = {
+    --     "bash",
+    --     "help",
+    --     "html",
+    --     "javascript",
+    --     "json",
+    --     "lua",
+    --     "markdown",
+    --     "markdown_inline",
+    --     "python",
+    --     "query",
+    --     "regex",
+    --     "tsx",
+    --     "typescript",
+    --     "vim",
+    --     "yaml",
+    --   },
+    -- },
   },
 }