diff dot_config/nvim/init.lua @ 305:10078cb76622

Add treesitter refactor and textobjects plugins Allows to rename variables only within the right scope, based on tree-sitter input
author zegervdv <zegervdv@me.com>
date Fri, 20 Nov 2020 18:01:10 +0100
parents f1590ff676ab
children 43ee619a8657
line wrap: on
line diff
--- a/dot_config/nvim/init.lua	Sat Nov 14 16:04:54 2020 +0100
+++ b/dot_config/nvim/init.lua	Fri Nov 20 18:01:10 2020 +0100
@@ -1,7 +1,6 @@
 local lsp = require'nvim_lsp'
 
 require "nvim-treesitter.highlight"
--- local hlmap = vim.treesitter.TSHighlighter.hl_map
 
 require'nvim-treesitter.configs'.setup {
   highlight = {
@@ -32,6 +31,23 @@
       },
     },
   },
+  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 = {},
@@ -43,7 +59,7 @@
 local chain_complete_list = {
   default = {
     default = {
-      {complete_items = {'lsp', 'snippet', 'buffer'}},
+      {complete_items = {'lsp', 'snippet', 'ts', 'buffer'}},
       {complete_items = {'path'}, triggered_only = {'/'}},
       {complete_items = {'ts'}},
     },