Browse Source

nixpkgs/neovim: use mini.ai for treesitter text objects

nvim-treesitter-text-objects doesn't support dot repeat with select. But
we do still need the package for the queries that it provides.
Thomas Dy 2 years ago
parent
commit
10822361a8
1 changed files with 11 additions and 7 deletions
  1. 11 7
      .config/nixpkgs/neovim/plugins.lua

+ 11 - 7
.config/nixpkgs/neovim/plugins.lua

@@ -92,19 +92,23 @@ require('mini.completion').setup({
   },
 });
 
+local spec_treesitter = require('mini.ai').gen_spec.treesitter
+
+require('mini.ai').setup({
+  custom_textobjects = {
+    [','] = spec_treesitter({
+      a = '@parameter.outer',
+      i = '@parameter.inner',
+    }),
+  },
+});
+
 -- Use Treesitter for syntax highlighting
 require('nvim-treesitter.configs').setup({
   highlight = {
     enable = true,
   },
   textobjects = {
-    select = {
-      enable = true,
-      keymaps = {
-        ['i,'] = '@parameter.inner',
-        ['a,'] = '@parameter.outer',
-      },
-    },
     swap = {
       enable = true,
       swap_next = {