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

Feat: Coc-cursors - Add a way to duplicate range. #4561

Open
Guilherhast opened this issue Mar 10, 2023 · 0 comments
Open

Feat: Coc-cursors - Add a way to duplicate range. #4561

Guilherhast opened this issue Mar 10, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Guilherhast
Copy link

Is your feature request related to a problem? Please describe.

If we select a range with coc-cursors-range there is no way you can select the same range again.

Example:

	document.getElementById();
	document.getElementById();
	document.getElementsByClassName();
	document.getElementsByTagName();

If I select the document word I can go to the next occurrence of the word.
But if I select something like: .get I can't do this.

Describe the solution you'd like

It would be nice If there were functions like cursors-duplicate-range and cursors-skip-range to this.

Alternatively, there could be a variable that holds the currently selected range ( coc-cursors-current-range ).
It wouldn't be hard to code the solution in lua.

Additional context

Lua functions I am using:

function _G.coc_cursors_skip()
	return [[<Plug>(coc-cursors-word)*<Plug>(coc-cursors-word):nohlsearch<CR>]]
end
function _G.coc_cursors_select_current()
	if vim.b['coc_cursors_activated'] == 1 then
		return [[*<Plug>(coc-cursors-word):nohlsearch<CR>]]
	else
		return [[<Plug>(coc-cursors-word)]]
	end
end

Feel free to add it to https://github.com/neoclide/coc.nvim/wiki/Multiple-cursors-support if you want.

@chemzqm chemzqm added the enhancement New feature or request label Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants