Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Acumane opened this issue Mar 16, 2025 · 0 comments
Open

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

Acumane opened this issue Mar 16, 2025 · 0 comments

Comments

@Acumane
Copy link

Acumane commented Mar 16, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant