Skip to content

The vm#cursors#operation function does not respect user-defined motion #282

@ngpong

Description

@ngpong

I am more accustomed to mapping $ and ^ to - and =, respectively. When setting key mappings, by specifying the mode as OPERATOR, it allows them to work well with commands like d, y, c, etc., in the native environment.

While exploring the plugin, I found that in cursor mode, VM waits for a motions command and does not recursively handle "some" user key mappings. The root cause of this behavior is due to the internal call let s:single = { c -> index(split('hljkwebWEB$^0{}()%nN_', '\zs'), c) >= 0 }, which is a hardcoded check to determine whether it belongs to the motion set. I can accept that this is a "rule," but one counterexample that puzzles me is: user-defined operator commands can work normally via the vim.g.VM_user_operators configuration. From my limited understanding, the term "motions" covers both operator and motion. Since VM_user_operators works fine, could you consider adding user-defined motion as well? (For instance, making some efforts with VM_custom_motions.)

Anyway, thank you very much to the community, this is a fantastic plugin!

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