changeset 370:5ffb0fd7b98d

Move treesitter config into packer_compiled
author zegervdv <zegervdv@me.com>
date Tue, 30 Mar 2021 21:47:55 +0200
parents eba1dee43703
children 1dfda47d5d9e
files dot_config/nvim/config.lua
diffstat 1 files changed, 61 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/dot_config/nvim/config.lua	Tue Mar 30 16:29:17 2021 +0200
+++ b/dot_config/nvim/config.lua	Tue Mar 30 21:47:55 2021 +0200
@@ -145,10 +145,69 @@
       end
     }
     use {
-      'nvim-treesitter/nvim-treesitter',
+      {
+        'nvim-treesitter/nvim-treesitter',
+        config = function ()
+          require "nvim-treesitter.highlight"
+
+          require'nvim-treesitter.configs'.setup {
+            highlight = {
+              enable = false,
+            },
+            incremental_selection = {
+              enable = true,
+              keymaps = {
+                init_selection = "gnn",
+                node_incremental = "grn",
+                scope_incremental = "grc",
+                node_decremental = "grm",
+              }
+            },
+            refactor = {
+              highlight_definitions = { enable = true },
+              smart_rename = {
+                enable = true,
+                keymaps = {
+                  smart_rename = "gsr",
+                },
+              },
+              navigation = {
+                enable = true,
+                keymaps = {
+                  goto_definition = "gnd",
+                  list_definitions = "gnD",
+                },
+              },
+            },
+            textobjects = {
+              move = {
+                enable = true,
+                goto_next_start = {
+                  ["]]"] = "@block.outer",
+                },
+                goto_previous_start = {
+                  ["[["] = "@block.outer",
+                },
+                goto_next_end = {
+                  ["]["] = "@block.outer",
+                },
+                goto_previous_end = {
+                  ["[]"] = "@block.outer",
+                },
+              },
+            },
+            playground = {
+              enable = true,
+              disable = {},
+              updatetime = 25,
+              persist_queries = false
+            }
+          }
+        end
+      },
       'nvim-treesitter/nvim-treesitter-refactor',
       'nvim-treesitter/nvim-treesitter-textobjects',
-      {'nvim-treesitter/playground', opt = true}
+      {'nvim-treesitter/playground', opt = true},
     }
     use {'SirVer/ultisnips'}
     use {
@@ -323,62 +382,6 @@
 local lsp = require'lspconfig'
 local lsputil = require'lspconfig.util'
 
-require "nvim-treesitter.highlight"
-
-require'nvim-treesitter.configs'.setup {
-  highlight = {
-    enable = false,
-  },
-  incremental_selection = {
-    enable = true,
-    keymaps = {
-      init_selection = "gnn",
-      node_incremental = "grn",
-      scope_incremental = "grc",
-      node_decremental = "grm",
-    }
-  },
-  refactor = {
-    highlight_definitions = { enable = true },
-    smart_rename = {
-      enable = true,
-      keymaps = {
-        smart_rename = "gsr",
-      },
-    },
-    navigation = {
-      enable = true,
-      keymaps = {
-        goto_definition = "gnd",
-        list_definitions = "gnD",
-      },
-    },
-  },
-  textobjects = {
-    move = {
-      enable = true,
-      goto_next_start = {
-        ["]]"] = "@block.outer",
-      },
-      goto_previous_start = {
-        ["[["] = "@block.outer",
-      },
-      goto_next_end = {
-        ["]["] = "@block.outer",
-      },
-      goto_previous_end = {
-        ["[]"] = "@block.outer",
-      },
-    },
-  },
-  playground = {
-    enable = true,
-    disable = {},
-    updatetime = 25,
-    persist_queries = false
-  }
-}
-
 local on_attach = function(client)
   mapper('n', '<CR>', '<cmd>lua require"lspsaga.diagnostic".show_line_diagnostics()<CR>')
   mapper('n', 'gd', '<cmd>lua vim.lsp.buf.declaration()<CR>')