From 677d978932bd34853cd4d4c0291a8c86eac576ad Mon Sep 17 00:00:00 2001 From: voidarc Date: Fri, 8 May 2026 17:59:12 +0100 Subject: [PATCH] made tabs better to use in general, telescope buffer picker navigates to open pane --- lua/config/binds.lua | 19 ++++++++++++++++++- lua/plugins/utils/telescope.lua | 12 ++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lua/config/binds.lua b/lua/config/binds.lua index 28c4a79..3d73074 100644 --- a/lua/config/binds.lua +++ b/lua/config/binds.lua @@ -83,5 +83,22 @@ Keymap("n", "fg", function() end) Keymap("n", "fb", function() - builtin.buffers({ cwd = vim.fn.expand("%:p:h") }) -- buffers don’t need cwd, but harmless + builtin.buffers({ show_all_buffers = true }) +end) + +-- Tab binds +Keymap("n", "l", function() + vim.cmd("tabnext") +end) + +Keymap("n", "h", function() + vim.cmd("tabprevious") +end) + +Keymap("n", "j", function() + vim.cmd("tabnew") +end) + +Keymap("n", "q", function() + vim.cmd("tabclose") end) diff --git a/lua/plugins/utils/telescope.lua b/lua/plugins/utils/telescope.lua index c2a1b20..466b22f 100644 --- a/lua/plugins/utils/telescope.lua +++ b/lua/plugins/utils/telescope.lua @@ -8,11 +8,23 @@ vim.pack.add({ { src = "https://github.com/2kabhishek/nerdy.nvim", name = "telescope-nerdy" }, }) +local actions = require("telescope.actions") require("telescope").setup({ defaults = { file_ignore_patterns = { ".git", ".venv", ".node_modules", "node_modules", ".svelte-kit", ".vscode" }, }, pickers = { + buffers = { + show_all_buffers = true, + mappings = { + i = { + [""] = actions.select_drop, + }, + n = { + [""] = actions.select_drop, + }, + }, + }, live_grep = { additional_args = function() return { "--hidden" }