telescope.nvim icon indicating copy to clipboard operation
telescope.nvim copied to clipboard

feat: Add shortcut for getting to the last search in every picker

Open dmtrKovalenko opened this issue 1 year ago • 5 comments

Is your feature request related to a problem? Please describe. The problem is that :Telescope resume is not ergonomic at all when you just want to quickly get back to the previous search, you need to remember the whole new command or a shortcut and always separate it from the regular search

Describe the solution you'd like I want to be able to get to the previous search with a simple <Up> binding like a native search does. Telescope already has this information stored so it should be fairly simple.

Describe alternatives you've considered

Additional context I'd like to open a PR, waiting for a green light 🟢

dmtrKovalenko avatar Feb 27 '24 11:02 dmtrKovalenko

Sorry I'm not super clear on where your idea differs from :Telescope resume.

What do you mean specifically when you say "get to the previous search with a simple binding"? Like a new action binding that auto populates an already open picker with the previously searched prompt or something?

jamestrew avatar Feb 28 '24 00:02 jamestrew

I mean by pressing up arrow

dmtrKovalenko avatar Feb 28 '24 12:02 dmtrKovalenko

Do you mean something like a history system similar to bash history, because we have this already? help telescope.defaults.history.

I have absolutely no idea what you mean sorry.

Conni2461 avatar Feb 29 '24 07:02 Conni2461

Just open the regular vim search and enter something then close it, open again and press arrow up -- it will go to the previous search.

I want to bring the same functionality in telescope.

Specifically: in every picker allow to get previous search result without separate command.

dmtrKovalenko avatar Feb 29 '24 08:02 dmtrKovalenko

thats just history cycling for prompt, but you cant get to the previous search results, that would result in storing every result that ever was returned, which could be several megabyte for a find files. i dont want to store that. its just easy to be able to cycle through previous prompts and that just loads the prompt. Did you read :help telescope.default.history and maybe :help telescope.actions.history and maybe this issue is also related https://github.com/nvim-telescope/telescope.nvim/issues/2290

Conni2461 avatar Feb 29 '24 08:02 Conni2461