From f78bc3b85881b43fd082add4c80d9a75c573a882 Mon Sep 17 00:00:00 2001 From: Miguel Palau Date: Fri, 8 Nov 2024 07:06:39 -0600 Subject: [PATCH] fix(telescope): buffers to start at final item (#4189) ## Description Currently hitting `fb` triggers the telescope buffers command but because we're passing the `sort_lastused=true` flag the index starts at the second item. This happens because of this line of code in telescope.nvim: https://github.com/nvim-telescope/telescope.nvim/blob/master/lua/telescope/builtin/__internal.lua#L941-L943 This makes it annoying to actually use the tool to find buffers because you have to first type your query then exit insert mode, then scroll one item down, and then hitting enter: https://github.com/user-attachments/assets/4126d017-df4b-48dc-b6d4-f7d9b8f491ff When removing that flag it makes the function much more usable in terms of UX since now you can just write your query and hit enter to go straight to it. ## Related Issue(s) ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/telescope.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua index bab88576..55ccaceb 100644 --- a/lua/lazyvim/plugins/extras/editor/telescope.lua +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -99,7 +99,11 @@ return { { ":", "Telescope command_history", desc = "Command History" }, { "", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, -- find - { "fb", "Telescope buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, + { + "fb", + "Telescope buffers sort_mru=true sort_lastused=true ignore_current_buffer=true", + desc = "Buffers", + }, { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, { "ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, { "fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },