brenton-leighton / multiple-cursors.nvim

A multi-cursor plugin for Neovim that works in normal, insert/replace, or visual modes, and with almost every command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: Public a function `add_cursor(row, col)` to add cursor in customized way

mrbeardad opened this issue · comments

Public a function add_cursor(row, col) to add cursor in customized way, such as flash.nvim

I've added a new function in the feat_add_cursor branch. The signature is add_cursor(lnum, col, curswant). Is that OK?

Maybe a seperate init() is required, because keymap set is too early.

You could take a look at this plugin vscode-multi-cursor.nvim

Maybe a seperate init() is required, because keymap set is too early.

Do you get an error? Is there a problem with settings key maps when add_cursor is called?

Maybe a seperate init() is required, because keymap set is too early.

Do you get an error? Is there a problem with settings key maps when add_cursor is called?

No, I mean, keymap set too earl that I can't type letters to choose label in flash, I need to init keymaps manually

I'm not sure how flash.nvim works, and I haven't looked much at how this plugin integrates with other plugins. Is there anyway you can create the cursors after choosing labels?

Yes, flash.nvim allow you to search for pattern, and display labels for user to press and jump, (like hop and easymotion).
And it provide a hook function to do something when user input a label, for me, I want add a cursor at label position that have choosed

You can use the disabled_default_key_maps option to disable the key maps the are causing trouble.

Otherwise is there a way you can save the new cursor positions somewhere, then add them all at once?

Otherwise is there a way you can save the new cursor positions somewhere, then add them all at once?

Sounds like a good idea