Skip to content

Missing mapping for r #283

@mikehaertl

Description

@mikehaertl

The documentation states:

We borrowed the aliases `r` and `a` from the |surround| plugin by Tim Pope.

But r is not working for me. It's also not listed in the defaults:

targets.vim/doc/targets.txt

Lines 727 to 763 in 642d3a4

This function can be used to modify an internal dictionary used to control the
mappings. The default value of that dictionary is:
{~
\ '(': {'pair': [{'o': '(', 'c': ')'}]},~
\ ')': {'pair': [{'o': '(', 'c': ')'}]},~
\ '{': {'pair': [{'o': '{', 'c': '}'}]},~
\ '}': {'pair': [{'o': '{', 'c': '}'}]},~
\ 'B': {'pair': [{'o': '{', 'c': '}'}]},~
\ '[': {'pair': [{'o': '[', 'c': ']'}]},~
\ ']': {'pair': [{'o': '[', 'c': ']'}]},~
\ '<': {'pair': [{'o': '<', 'c': '>'}]},~
\ '>': {'pair': [{'o': '<', 'c': '>'}]},~
\ '"': {'quote': [{'d': '"'}]},~
\ "'": {'quote': [{'d': "'"}]},~
\ '`': {'quote': [{'d': '`'}]},~
\ ',': {'separator': [{'d': ','}]},~
\ '.': {'separator': [{'d': '.'}]},~
\ ';': {'separator': [{'d': ';'}]},~
\ ':': {'separator': [{'d': ':'}]},~
\ '+': {'separator': [{'d': '+'}]},~
\ '-': {'separator': [{'d': '-'}]},~
\ '=': {'separator': [{'d': '='}]},~
\ '~': {'separator': [{'d': '~'}]},~
\ '_': {'separator': [{'d': '_'}]},~
\ '*': {'separator': [{'d': '*'}]},~
\ '#': {'separator': [{'d': '#'}]},~
\ '/': {'separator': [{'d': '/'}]},~
\ '\': {'separator': [{'d': '\'}]},~
\ '|': {'separator': [{'d': '|'}]},~
\ '&': {'separator': [{'d': '&'}]},~
\ '$': {'separator': [{'d': '$'}]},~
\ 't': {'tag': [{}]},~
\ 'a': {'argument': [{'o': '[([]', 'c': '[])]', 's': ','}]},~
\ 'b': {'pair': [{'o':'(', 'c':')'}, {'o':'[', 'c':']'}, {'o':'{', 'c':'}'}]},~
\ 'q': {'quote': [{'d':"'"}, {'d':'"'}, {'d':'`'}]},~
\ }~

I had to add it with:

autocmd User targets#mappings#user call targets#mappings#extend({
    \ 'r': {'pair': [{'o':'[', 'c':']'}]}
    \ })

So I think either the docs should be updated or the mapping added.

There's also a little typo (incude) here:

|targets-quote-seek|. Unlike Vim's quote text objects, this incudes no

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions