From 4485e748694d5e37d611730b40881b4ff8aea6dd Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 24 Jul 2024 21:49:37 +0200 Subject: [PATCH] sort telescope recent buffers based on usage --- lua/kickstart/plugins/telescope.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/telescope.lua b/lua/kickstart/plugins/telescope.lua index b8c6eb5..37aa1e4 100644 --- a/lua/kickstart/plugins/telescope.lua +++ b/lua/kickstart/plugins/telescope.lua @@ -114,7 +114,11 @@ return { vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', 'sc', builtin.command_history, { desc = '[S]earch [C]ommand History' }) - vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', '', function() + builtin.buffers { + sort_mru = true, + } + end, { desc = '[ ] Find existing buffers' }) -- Telescope live_grep in git root -- Function to find the git root directory based on the current buffer's path