Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

[Feature Request] Will Comman's comment connect with treesitter's textobjects? #4

Open
NEX-S opened this issue Oct 25, 2022 · 1 comment

Comments

@NEX-S
Copy link

NEX-S commented Oct 25, 2022

for example: gcif can use treesitter's textobjects and add comments in the function

    textobjects = {
        select = {
            enable = true,
            -- Automatically jump forward to textobj, similar to targets.vim
            lookahead = true,
            keymaps = {
                -- You can use the capture groups defined in textobjects.scm
                -- ["ia"] = "@attribute.inner",
                -- ["aa"] = "@attribute.outer",

                ["iB"] = "@block.inner",
                ["aB"] = "@block.outer",

                ["c"] = "@call.inner",  -- all call args
                ["C"] = "@call.outer",

                ["ic"] = "@class.inner",
                ["ac"] = "@class.outer",

                ["ii"] = "@conditional.inner",  -- if
                ["ai"] = "@conditional.outer",  -- if

                ["aF"] = "@frame.inner",
                ["iF"] = "@frame.outer",

                ["if"] = "@function.inner", -- function
                ["af"] = "@function.outer", -- funiction

                ["il"] = "@loop.inner", -- loop
                ["al"] = "@loop.outer", -- loop

                ["ia"] = "@parameter.inner",  -- args
                ["aa"] = "@parameter.outer",  -- args

                ["/"] = "@comment.outer",
                -- ["is"] = "@scopename.inner",
                ["is"] = "@statement.outer", -- statement
            },
        },
@glepnir
Copy link
Member

glepnir commented Oct 26, 2022

also think about this. should be support.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants