Skip to content

Commit

Permalink
Sort buffer listing by most recently used
Browse files Browse the repository at this point in the history
I'm hoping this will make it easier to pick buffers.

This change necessitated using the Lua interface rather than the
command.
  • Loading branch information
jordelver committed Oct 26, 2023
1 parent 1ab0f22 commit 17c5ff9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion config/nvim/lua/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ vim.keymap.set('n', '<leader>ff', '<cmd>Telescope find_files<cr>', { noremap = t
vim.keymap.set('n', '<leader>fg', '<cmd>Telescope live_grep<cr>', { noremap = true })

-- Fuzzily find open buffers
vim.keymap.set('n', '<leader>fb', '<cmd>Telescope buffers<cr>', { noremap = true })
vim.keymap.set('n', '<leader>fb', function ()
require("telescope.builtin").buffers({
-- Sorts all buffers by most recently used
sort_mru = true,
})
end
, { noremap = true, desc = 'Telescope buffers' })

-- Fuzzily find Neovim help topics
vim.keymap.set('n', '<leader>fh', '<cmd>Telescope help_tags<cr>', { noremap = true })
Expand Down

0 comments on commit 17c5ff9

Please sign in to comment.