-
-
Notifications
You must be signed in to change notification settings - Fork 855
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
Unable to paste multiline text into telescope's input box #2882
Comments
Hmm.. the prompt buffer is using But still Also what is command+v? is that |
Thank you. |
I am using kickerstarter.nvim, this is my config => https://github.com/shibisuriya/nvim/blob/main/init.lua, I have just made slight config to kickerstarter.nvim... |
This doesn't exist in telescope. Maybe we can add it? I don't feel strongly about it. But it seems like
With |
I am using this... vim.keymap.set('n', 'fg', function() Doesn't work... |
Can you be more descriptive about what's not working? |
Running into the same issues. Can't seem to paste using os clipboard or p in normal mode. Would love to see this feature! |
@jamestrew |
Is there any work around for this, I feel like this is a very basic and essential function for any text editor.... I am unable to copy a bunch of html lines from chrome's inspect and search for them in the codebase... I am switching to vs code for this purpose then coming back to nvim to continue work... |
you need to escape the parentheses. |
With the way telescope uses a prompt-buffer, this isn't a trivial problem for telescope I think. I think we can have a workaround for pasting, but the multiline search is a bit tricky to get cleanly currently. Not saying this won't ever be possible with telescope but there might be existing neovim plugins that handle this workflow better. Sorry. |
workaround for pasting require("telescope").setup({
defaults = {
mappings = {
n = {
["p"] = function(prompt_bufnr)
local current_picker = action_state.get_current_picker(prompt_bufnr)
local text = vim.fn.getreg('+'):gsub("\n", "\\n") -- which register depends on clipboard option
current_picker:set_prompt(text, false)
end,
},
},
},
}) |
@shibisuriya @jamestrew I don't think it's a good way, but it works.
With this solution you can select one or more lines in visual mode and search for them using sorry for my bad English |
Thank you @ArnaudDelgerie!! This works, but it is becoming annoying when I am working on a huge codebase, if my search query contains 3 lines of text, the same result is appearing thrice... |
@jamestrew is there any way to convert 3 results into 1? Also are there any plugins that your recommend for this workflow alone (searching multi line strings in a codebase)... |
there is, I think this PR will address this but it's been pending a neovim 0.2 release so it won't be available for a while I don't think #2536
I'm not aware of any that will let you just paste a multiline text into a search. Maybe try grug-far? This issue might have some answers MagicDuck/grug-far.nvim#198 |
Description
I have copied a multiline text using 'yit', this yanks everything that is written within a
in my case... I want to search the content using telescope to know if this piece of code exists somewhere else as well in the codebase or not... I am using kickerstarter.nvim btw.Neovim version
Operating system and version
macos montery v12.5
Telescope version / branch / rev
checkhealth telescope
Steps to reproduce
Expected behavior
No response
Actual behavior
I want be able to search multiline text that was copied using telescope.nvim.
Minimal config
The text was updated successfully, but these errors were encountered: