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

Expose mechanism for generating mappings... #12

Closed
jszakmeister opened this issue Jan 27, 2013 · 0 comments
Closed

Expose mechanism for generating mappings... #12

jszakmeister opened this issue Jan 27, 2013 · 0 comments

Comments

@jszakmeister
Copy link

textobj#user#plugin() takes an obj_spec parameter describing how to wire up the mappings. It'd be nice to expose that machinery. For instance, I've been looking at vim-textobj-diff. While I like most of what it does, I'd like to map things a little differently (use [[, ]], [], ][ to navigate hunks and have the mappings be buffer specific, and they'll be setup at filetype detect time). Unfortunately, it turns out to be quite a bit of work redoing what plugin() is already helping with. It'd be nice to avoid that, and make it so that I can do something like:

call textobj#user#mapping('diff', {
\      'file': {
\        'move-N': '<Leader>dfJ',
\        'move-P': '<Leader>dfK',
\        'move-n': '<Leader>dfj',
\        'move-p': '<Leader>dfk',
\        'select': ['adH', 'adf', 'idH', 'idf'],
\      },
\      'hunk': {
\        'move-n': ']]',
\        'move-N': '][',
\        'move-p': '[[',
\        'move-P': '[]',
\        'select': ['adh', 'idh'],
\      },
\    })
jszakmeister added a commit to jszakmeister/vim-textobj-user that referenced this issue Jan 27, 2013
This fixes kana#12: expose mechanism for generating mappings.
@kana kana closed this as completed in 1da1d82 Feb 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant