Skip to content

operator pending mapping #8

@liushapku

Description

@liushapku

Currently, the map is simply omap <Plug>(operator-xxx) g@. It doesn't check that the pending operation is the same as <Plug>(operator-xxx). Can we change it to the following?

omap <expr> (v:operator == "g@" && &opfunc == function_name) ? "g@" : "\<esc>"

To do it, the last line of function operator#user#_define should be changed to

  execute printf('onoremap <expr> %s (v:operator == "g@" && &opfunc == "%s")? "g@" : "\<esc>"',
              \  a:operator_keyseq, a:function_name)

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