chore: remove tab options and keymaps

This commit is contained in:
2026-01-28 20:06:03 +01:00
parent 0f4619f53b
commit 81304571e8
2 changed files with 0 additions and 73 deletions
-68
View File
@@ -42,74 +42,6 @@ vim.keymap.set("n", "<leader>bp", ":bprevious<CR>", { desc = "Previous buffer" }
vim.keymap.set("n", "<leader>e", ":Explore<CR>", { desc = "Open file explorer" }) vim.keymap.set("n", "<leader>e", ":Explore<CR>", { desc = "Open file explorer" })
vim.keymap.set("n", "<leader>ff", ":find ", { desc = "Find file" }) vim.keymap.set("n", "<leader>ff", ":find ", { desc = "Find file" })
-- Tab Navigation
vim.keymap.set('n', '<leader>tn', ':tabnew<CR>', { desc = 'New tab' })
vim.keymap.set('n', '<leader>tx', ':tabclose<CR>', { desc = 'Close tab' })
vim.keymap.set('n', '<leader>tm', ':tabmove<CR>', { desc = 'Move tab' })
vim.keymap.set('n', '<leader>t>', ':tabmove +1<CR>', { desc = 'Move tab right' })
vim.keymap.set('n', '<leader>t<', ':tabmove -1<CR>', { desc = 'Move tab left' })
-- Function to open file in new tab
local function open_file_in_tab()
vim.ui.input({ prompt = 'File to open in new tab: ', completion = 'file' }, function(input)
if input and input ~= '' then
vim.cmd('tabnew ' .. input)
end
end)
end
-- Function to duplicate current tab
local function duplicate_tab()
local current_file = vim.fn.expand('%:p')
if current_file ~= '' then
vim.cmd('tabnew ' .. current_file)
else
vim.cmd('tabnew')
end
end
-- Function to close tabs to the right
local function close_tabs_right()
local current_tab = vim.fn.tabpagenr()
local last_tab = vim.fn.tabpagenr('$')
for i = last_tab, current_tab + 1, -1 do
vim.cmd(i .. 'tabclose')
end
end
-- Function to close tabs to the left
local function close_tabs_left()
local current_tab = vim.fn.tabpagenr()
for i = current_tab - 1, 1, -1 do
vim.cmd('1tabclose')
end
end
vim.keymap.set('n', '<leader>tO', open_file_in_tab, { desc = 'Open file in new tab' })
vim.keymap.set('n', '<leader>td', duplicate_tab, { desc = 'Duplicate current tab' })
vim.keymap.set('n', '<leader>tr', close_tabs_right, { desc = 'Close tabs to the right' })
vim.keymap.set('n', '<leader>tL', close_tabs_left, { desc = 'Close tabs to the left' })
-- Function to close buffer but keep tab if it's the only buffer in tab
local function smart_close_buffer()
local buffers_in_tab = #vim.fn.tabpagebuflist()
if buffers_in_tab > 1 then
vim.cmd('bdelete')
else
-- If it's the only buffer in tab, close the tab
vim.cmd('tabclose')
end
end
vim.keymap.set('n', '<leader>bd', smart_close_buffer, { desc = 'Smart close buffer/tab' })
-- Diagnostic keymaps -- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
-5
View File
@@ -93,8 +93,3 @@ local undodir = vim.fn.expand("~/.vim/undodir")
if vim.fn.isdirectory(undodir) == 0 then if vim.fn.isdirectory(undodir) == 0 then
vim.fn.mkdir(undodir, "p") vim.fn.mkdir(undodir, "p")
end end
-- Tabs
vim.o.showtabline = 1
vim.o.tabline = ''