Skip to content

Add support to configure custom text objects #9742

@gayanper

Description

@gayanper

Today we lack support for treesitter text objects like

  • Inside Function
  • Around Function

Rather than this plugin try to build these text objects, another suggestion is open up for registering text object commands via settings into this plugin

This way other plugins can provide support to implement new text-object implementations and configure them

I would like to explore the possibility to

  • Create a new type of TextObject which is configured for each configuration found in the settings. This new type will take the TextObject.keys from a provided key array in the setting object and a vscode command id. The command represented by the id must have a return type of Omit<IMovement, "removed">.

  • The settings will follow a schema as follows

"vim.textobjects": [
     {
        "keys": ["a", "f"]
        "command" : ["x.arround.function"]
     }
]
  • When we load settings, we will load these text objects into actions map.

If the idea sounds good let me know, I can provide a PR for this suggestion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions