diff --git a/lua/kickstart/plugins/which-key.lua b/lua/kickstart/plugins/which-key.lua index 0a1dd47..eddbedf 100644 --- a/lua/kickstart/plugins/which-key.lua +++ b/lua/kickstart/plugins/which-key.lua @@ -19,39 +19,25 @@ return { 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 { - ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, - ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, - ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, - ['g'] = { name = '[G]it/[G]lobal', _ = 'which_key_ignore' }, - ['b'] = { name = '[B]uffer/[B]reakpoint', _ = 'which_key_ignore' }, - ['c'] = { name = '[C]ode/[C]odeium/[C]hange', _ = 'which_key_ignore' }, - ['cd'] = { name = '[D]irectory', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument/[D]elete', _ = 'which_key_ignore' }, - ['h'] = { name = 'Git [H]unk/[H]arpoon', _ = 'which_key_ignore' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, - ['dn'] = { name = '[N]o', _ = 'which_key_ignore' }, - ['l'] = { name = '[L]ist', _ = 'which_key_ignore' }, - ['f'] = { name = '[F]ormat/[F]ile', _ = 'which_key_ignore' }, - ['o'] = { name = '[O]verseer', _ = 'which_key_ignore' }, + require('which-key').add { + { 'c', group = '[C]ode-/[C]hange' }, + { 'd', group = '[D]ocument/[D]elete', mode = { 'n', 'v' } }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, + { 't', group = '[T]oggle', mode = { 'n', 'v' } }, + { 'h', group = 'Git [H]unk/[H]arpoon', mode = { 'n', 'v' } }, + { 'g', group = '[G]it/[G]lobal', mode = { 'n', 'v' } }, + { 'b', group = '[B]uffer/[B]reakpoint' }, + { 'cd', group = '[D]irectory' }, + { 'dn', group = '[N]o', mode = { 'n', 'v' } }, + { 'l', group = '[L]ist', mode = { 'n', 'v' } }, + { 'f', group = '[F]ormat/[F]ile', mode = { 'n', 'v' } }, + { 'o', group = '[O]verseer', mode = { 'n', 'v' } }, + { 'p', group = '[P]aste', mode = { 'v' } }, + { 'pn', group = '[N]o', mode = { 'v' } }, } - - -- register which-key VISUAL mode - -- required for visual hs (hunk stage) to work - require('which-key').register({ - [''] = { name = 'VISUAL ' }, - ['h'] = { 'Git [H]unk' }, - ['d'] = { name = '[D]elete', _ = 'which_key_ignore' }, - ['p'] = { name = '[P]aste', _ = 'which_key_ignore' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, - ['dn'] = { name = '[N]o', _ = 'which_key_ignore' }, - ['pn'] = { name = '[N]o', _ = 'which_key_ignore' }, - ['l'] = { name = '[L]ist', _ = 'which_key_ignore' }, - ['f'] = { name = '[F]ormat/[F]ile', _ = 'which_key_ignore' }, - ['g'] = { name = '[G]lobal', _ = 'which_key_ignore' }, - }, { mode = 'v' }) end, }, } diff --git a/lua/lazy-bootstrap.lua b/lua/lazy-bootstrap.lua index 0a8f800..3765999 100644 --- a/lua/lazy-bootstrap.lua +++ b/lua/lazy-bootstrap.lua @@ -3,14 +3,17 @@ local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' if not vim.loop.fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' - vim.fn.system { + local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, - lazypath + lazypath, } + if vim.v.shell_error ~= 0 then + error('Error cloning lazy.nvim:\n' .. out) + end end ---@diagnostic disable-next-line: undefined-field vim.opt.rtp:prepend(lazypath)