-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add visual paste #129
base: main
Are you sure you want to change the base?
Add visual paste #129
Conversation
So the problem we're facing with a nicer visual range support is that it seems that Telescope does not support ranges. This means we can't allow a range mapping like it is done with If Telescope allowed a visual range, the same mapping could be used and we would be able to work on this range without the need for Another solution would be to provide a separate command that we control the setup for because then we could add |
I haven't checked out the fzf part. |
https://github.com/gbprod/yanky.nvim is possible to work around this limitation by using Telescope just as a picker so it has it's own command set up with a range and then accesses Telescope after it exited visual mode, see gbprod/yanky.nvim#136 (if I understood it correctly). |
0e5d03c
to
18b96ac
Compare
Closes AckslD#128
18b96ac
to
fe02b72
Compare
|
||
```vim | ||
<ESC>:Telescope neoclip<CR> | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explanation for fzf-lua
needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peterfication sorry for the very late reply! I think this looks nice and works from what I can see when testing. It would be ideal if telescope
worked in visual mode but this seems fine to me and is not breaking anything for anyone not wanting it.
@@ -91,11 +91,24 @@ end | |||
|
|||
-- TODO can this be done without setting the register? | |||
M.paste = function(entry, op) | |||
if op == "v" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] should this be done inside the function passed to temporary_reg_usage
below in order to call this function at two places? Eg
temporary_reg_usage(entry, function(register_name)
if op == 'v' then
vim.api.nvim_feedkeys('gv"'..register_name..'p', "n", false)
else
vim.cmd(string.format('normal! "%s%s', register_name, op))
end
end)
also is nvim_feedkeys
required here or could it also use vim.cmd
, I guess the visual part maybe breaks this?
Closes #128