Skip to content

Support mapping an operator (g@ and operatorfunc) #199

Open

Description

@natetarrh

From :help map-operator:

g@{motion}		Call the function set by the 'operatorfunc' option.
			The '[ mark is positioned at the start of the text
			moved over by {motion}, the '] mark on the last
			character of the text.
			The function is called with one String argument:
			    "line"	{motion} was |linewise|
			    "char"	{motion} was |characterwise|
			    "block"	{motion} was |blockwise-visual|

Looking into what a proper surround.vim port would take, this is necessary for defining and applying the "surround" operator.

Activity

  1. nightwing commented on Jan 13, 2025

    @nightwing
    Collaborator

    The problem is that we do not have support for defining functions to use with operatorfunc.

    Are you trying to use surround.vim implemented in vim script? It may be easier to implement it in javascript instead of adding vimscript support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions