Skip to content

Access cursor state (e.g. quantity) for use in contextual keymaps #11

Open
@Acumane

Description

@Acumane

Looking to make contextual keymaps so that entering insert mode "starts" existing multi-cursors. I couldn't manage it myself with #STATE.cursors... here's approximately how I'd like it to work anyway:

...
local cursors = require("vscode-multi-cursor")

vim.keymap.set({ 'n' }, 'i', function()
  #cursors.STATE > 0 and cursors.start_left() or util.feedkeys('i')
end)
...

So in the absence of multi-cursors, i acts normally.

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