kana/vim-textobj-user — pull request #14 by jszakmeister (2013-01-27 11:45:55+00:00)
Title: Add an easy way for users to create mappings to existing plugins.

I really like textobj-user... it's a will written library, and easily accessible. However, I'd like to add mappings to existing plugins when editing specific kinds of files. For example, patch files. It'd be nice to remap `[[`, `]]`, `[]`, and `][` to bounce around hunks in the file. Currently, that's difficult to do. So this pull request factors out some of the machinery in textobj-user and exposes it for users to call. It creates a new method called `textobj#user#mapping()` and they can use `{obj-specs}` to help define what they need (so they can use the plugin as a starting point). In turn, the user can add something like this to `after/ftplugin/diff.vim` to enable jumping with the above keys:

```vim
call textobj#user#mapping('diff', {
\ 'hunk': {
\ 'move-n': ']]',
\ 'move-N': '][',
\ 'move-p': '[[',
\ 'move-P': '[]',
\ },
\ })
```

The documentation was updated as well. If there's anything you'd like me to fix up, please let me know. I'm willing to iterate on this if you don't find it up to your standards.

BTW, this also takes care of the issue I opened (#12).