Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per mapping/object options #156

Open
stsewd opened this issue Dec 21, 2021 · 1 comment
Open

Per mapping/object options #156

stsewd opened this issue Dec 21, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@stsewd
Copy link
Member

stsewd commented Dec 21, 2021

Features like #150 and #125 would benefit from being per-mapping/objects instead of global options.

Our current settings look like this

      keymaps = {
        ["af"] = "@function.outer",
        ["if"] = "@function.inner",
        ["ac"] = "@class.outer",
        ["ic"] = "@class.inner",
      }

We could extend them to something like

-- Global options are defined here
-- lookahead = true,
keymaps = {
  ["af"] = {
    textobject = "@function.outer",
    -- If these options aren't given the global/default ones
    -- are used.
    lookahead = true,
    auto_expand = true,
  },
  -- This form is valid, and it uses the global options.
  ["if"] = "@function.inner"
}
@ilan-schemoul
Copy link
Contributor

ilan-schemoul commented Mar 30, 2024

I also think it is relevant for another use case : I added a custom @type to my custom files so I can select the type of a declaration for example in int i = 8 I can select int. Here I clearly prefer lookbehind than lookahead but do not want to modify global settings.
I therefore made a PR #588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants