RRethy / nvim-treesitter-textsubjects

Location and syntax aware text objects which *do what you mean*

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mappings are not triggered

vdawg-git opened this issue · comments

commented

I just installed treesitter-text-objects and treesitter-textsubjects ( really cool plugin btw, thank you for your work! )

However, I cannot make it work. treesitter-text-objects does work, the mapping of textsubjects refuse to get triggered though. Am I misunderstanding the mappings? v ; for example does not work for me.

Here is my treesitter config (taken from here):

require'nvim-treesitter.configs'.setup {
    ensure_installed = {"help", "javascript", "typescript", "lua"},
    sync_install = false,
    auto_install = true,

    textobjects = {
        select = {
            enable = true,
            lookahead = true,
            keymaps = {
                ["ia"] = "@parameter.inner",
                ["aa"] = "@parameter.outer"
            },
            include_surrounding_whitespace = true
        },
        move = {
            enable = true,
            goto_next_start = {
                [']m'] = '@function.outer'
            },
            goto_previous_start = {
                ['[m'] = '@function.outer'
            }
        }
    },

    endwise = {
        enable = true
    },

    textsubjects = {
        enable = true,
        prev_selection = ',',
        keymaps = {
            ['<cr>'] = 'textsubjects-smart',
            [';'] = 'textsubjects-container-outer',
            ['i;'] = 'textsubjects-container-inner'
        }
    }
}

And here is my whole config (I am a beginner so it is really simple)

Windows 11
NVIM v0.8.3
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Create a minimal config, it's not practical for me to read and grok your whole config.

v ; for example does not work for me.

Also create a reproducible example, v; not working doesn't mean anything without context.

commented

I created one and I it does work now, just not always as expected.
In this .lua config file from the minimal config (which I used for testing the plugin) textsubjects-container-outer - and inner do not work - but smart works.

So yeah, my fault, and thank you for this plugin. It is really nice