VSCodeVim / VSCodeVim/Vim

Add support to configure custom text objects

Open
#9,742 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how settings are loaded and how the actions map currently registers text objects. Review the existing TextObject types and command-handling paths before deciding how the proposed keys and command settings fit them. Done means configured command-backed text objects can be registered from the documented settings schema and invoked through their configured keys.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.