From b7014515ccd9a60151996df70324cf477fa7b05f Mon Sep 17 00:00:00 2001 From: juanito87 Date: Mon, 14 Apr 2025 13:12:18 -0300 Subject: [PATCH] Updating whic-key config --- lua/lazy-config.lua | 4 ++- lua/plugins_config/which-key.lua | 49 ++++++++++++++++++-------------- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/lua/lazy-config.lua b/lua/lazy-config.lua index c06655c5..79fdd365 100644 --- a/lua/lazy-config.lua +++ b/lua/lazy-config.lua @@ -1,4 +1,4 @@ --- [[ Configure and install plugins ]] +--[[ Configure and install plugins ]] -- To check the current status of your plugins, run -- :Lazy -- @@ -18,6 +18,7 @@ require('lazy').setup({ -- One liners -- Highlight todo, notes, etc in comments { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, + { 'CRAG666/code_runner.nvim', config = true }, -- Exe3cute code within nvim. -- Plugins with custom values require 'plugins_config/which-key', -- Show created key bindings @@ -32,6 +33,7 @@ require('lazy').setup({ require 'plugins_config/mini', -- Collections of useful mini plugins, like around/surround require 'plugins_config/tree-sitter', -- manage lint, indentation and some othe language related tasks require 'plugins_config/harpoon', -- Improve workflow for multiple files + -- require 'plugins_config/code_runner', -- Code runner -- require 'plugins_config/copilot', -- copilot config -- Broken configs/Testing config diff --git a/lua/plugins_config/which-key.lua b/lua/plugins_config/which-key.lua index a5585ca4..cce7e5ed 100644 --- a/lua/plugins_config/which-key.lua +++ b/lua/plugins_config/which-key.lua @@ -1,22 +1,29 @@ - return { -- Useful plugin to show you pending keybinds. - 'folke/which-key.nvim', - event = 'VimEnter', -- Sets the loading event to 'VimEnter' - config = function() -- This is the function that runs, AFTER loading - require('which-key').setup() +return { -- Useful plugin to show you pending keybinds. + 'folke/which-key.nvim', + event = 'VimEnter', -- Sets the loading event to 'VimEnter' + config = function() -- This is the function that runs, AFTER loading + require('which-key').setup() - -- Document existing key chains - require('which-key').register { - ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, - ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, - ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, - ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, - ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, - } - -- visual mode - require('which-key').register({ - ['h'] = { 'Git [H]unk' }, - }, { mode = 'v' }) - end, - } + -- Document existing key chains + require('which-key').add { + { 'c', group = '[C]ode' }, + { 'c_', hidden = true }, + { 'd', group = '[D]ocument' }, + { 'd_', hidden = true }, + { 'h', group = 'Git [H]unk' }, + { 'h_', hidden = true }, + { 'r', group = '[R]ename' }, + { 'r_', hidden = true }, + { 's', group = '[S]earch' }, + { 's_', hidden = true }, + { 't', group = '[T]oggle' }, + { 't_', hidden = true }, + { 'w', group = '[W]orkspace' }, + { 'w_', hidden = true }, + } + -- visual mode + require('which-key').add { + { 'h', desc = 'Git [H]unk', mode = 'v' }, + } + end, +}