From 2e8a5a85148413304aadecc3d0f163ade47fe7c5 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Sun, 27 Aug 2023 14:56:33 -0600 Subject: feat: add tab navigation keybinds, refactor which-key settings --- .editorconfig | 2 +- lua/config/keymap.lua | 8 ++++++++ lua/plugins/init.lua | 2 -- lua/plugins/which-key.lua | 9 +++++++++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 lua/plugins/which-key.lua diff --git a/.editorconfig b/.editorconfig index 3ff67ef..bd050fb 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,4 +11,4 @@ charset = utf-8 # 4 space indentation [*.lua] indent_style = space -indent_size = 4 +indent_size = 2 diff --git a/lua/config/keymap.lua b/lua/config/keymap.lua index 6d99cfa..81b4498 100644 --- a/lua/config/keymap.lua +++ b/lua/config/keymap.lua @@ -20,3 +20,11 @@ vim.keymap.set('n', '', 'vertical resize -5', { desc = 'Split: vim.keymap.set('n', '', 'resize +5', { desc = 'Split: Resize down', noremap = true }) vim.keymap.set('n', '', 'resize -5', { desc = 'Split: Resize up', noremap = true }) vim.keymap.set('n', '', 'vertical resize +5', { desc = 'Split: Resize right', noremap = true }) + +-- Tab navigation +vim.keymap.set('n', 'tn', 'tabnew', { desc = '[T]ab: [n]ew' }) +vim.keymap.set('n', 'te', 'tabedit', { desc = '[T]ab: [e]dit'}) +vim.keymap.set('n', 'td', 'tabclose', { desc = '[T]ab: [d]elete'}) +vim.keymap.set('n', 'tl', 'tabnext', { desc = 'Tab: next'}) +vim.keymap.set('n', 'th', 'tabprev', { desc = 'Tab: prev'}) + diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index c0cf279..47427b0 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -5,8 +5,6 @@ return { -- Detect tabstop and shiftwidth automatically -- luevano: not sure how I feel about this, need to check later 'tpope/vim-sleuth', - -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, -- "gc" to comment visual regions/lines { 'numToStr/Comment.nvim', opts = {} }, -- required for nvim-qt on windows diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..0947703 --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,9 @@ +return { + 'folke/which-key.nvim', + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + opts = {} +} -- cgit v1.2.3-54-g00ecf