From 81304571e85c5bcc73a5eabadbbf6dceeeff3ea3 Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Wed, 28 Jan 2026 20:06:03 +0100 Subject: [PATCH] chore: remove tab options and keymaps --- lua/keymaps.lua | 68 ------------------------------------------------- lua/options.lua | 5 ---- 2 files changed, 73 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 9cda759..040f74d 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -42,74 +42,6 @@ vim.keymap.set("n", "bp", ":bprevious", { desc = "Previous buffer" } vim.keymap.set("n", "e", ":Explore", { desc = "Open file explorer" }) vim.keymap.set("n", "ff", ":find ", { desc = "Find file" }) --- Tab Navigation - -vim.keymap.set('n', 'tn', ':tabnew', { desc = 'New tab' }) -vim.keymap.set('n', 'tx', ':tabclose', { desc = 'Close tab' }) -vim.keymap.set('n', 'tm', ':tabmove', { desc = 'Move tab' }) -vim.keymap.set('n', 't>', ':tabmove +1', { desc = 'Move tab right' }) -vim.keymap.set('n', 't<', ':tabmove -1', { 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', 'tO', open_file_in_tab, { desc = 'Open file in new tab' }) -vim.keymap.set('n', 'td', duplicate_tab, { desc = 'Duplicate current tab' }) -vim.keymap.set('n', 'tr', close_tabs_right, { desc = 'Close tabs to the right' }) -vim.keymap.set('n', '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', 'bd', smart_close_buffer, { desc = 'Smart close buffer/tab' }) - -- Diagnostic keymaps vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) diff --git a/lua/options.lua b/lua/options.lua index 3cad2a0..fca7323 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -93,8 +93,3 @@ local undodir = vim.fn.expand("~/.vim/undodir") if vim.fn.isdirectory(undodir) == 0 then vim.fn.mkdir(undodir, "p") end - --- Tabs - -vim.o.showtabline = 1 -vim.o.tabline = ''