Merge remote-tracking branch 'modular/master'

This commit is contained in:
Baipyrus 2024-07-18 20:54:53 +02:00
commit bc57aa34ed
2 changed files with 22 additions and 33 deletions

View File

@ -19,39 +19,25 @@ return {
event = 'VimEnter', -- Sets the loading event to 'VimEnter' event = 'VimEnter', -- Sets the loading event to 'VimEnter'
config = function() -- This is the function that runs, AFTER loading config = function() -- This is the function that runs, AFTER loading
require('which-key').setup() require('which-key').setup()
-- Document existing key chains -- Document existing key chains
require('which-key').register { require('which-key').add {
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' }, { '<leader>c', group = '[C]ode-/[C]hange' },
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' }, { '<leader>d', group = '[D]ocument/[D]elete', mode = { 'n', 'v' } },
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, { '<leader>r', group = '[R]ename' },
['<leader>g'] = { name = '[G]it/[G]lobal', _ = 'which_key_ignore' }, { '<leader>s', group = '[S]earch' },
['<leader>b'] = { name = '[B]uffer/[B]reakpoint', _ = 'which_key_ignore' }, { '<leader>w', group = '[W]orkspace' },
['<leader>c'] = { name = '[C]ode/[C]odeium/[C]hange', _ = 'which_key_ignore' }, { '<leader>t', group = '[T]oggle', mode = { 'n', 'v' } },
['<leader>cd'] = { name = '[D]irectory', _ = 'which_key_ignore' }, { '<leader>h', group = 'Git [H]unk/[H]arpoon', mode = { 'n', 'v' } },
['<leader>d'] = { name = '[D]ocument/[D]elete', _ = 'which_key_ignore' }, { '<leader>g', group = '[G]it/[G]lobal', mode = { 'n', 'v' } },
['<leader>h'] = { name = 'Git [H]unk/[H]arpoon', _ = 'which_key_ignore' }, { '<leader>b', group = '[B]uffer/[B]reakpoint' },
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, { '<leader>cd', group = '[D]irectory' },
['<leader>dn'] = { name = '[N]o', _ = 'which_key_ignore' }, { '<leader>dn', group = '[N]o', mode = { 'n', 'v' } },
['<leader>l'] = { name = '[L]ist', _ = 'which_key_ignore' }, { '<leader>l', group = '[L]ist', mode = { 'n', 'v' } },
['<leader>f'] = { name = '[F]ormat/[F]ile', _ = 'which_key_ignore' }, { '<leader>f', group = '[F]ormat/[F]ile', mode = { 'n', 'v' } },
['<leader>o'] = { name = '[O]verseer', _ = 'which_key_ignore' }, { '<leader>o', group = '[O]verseer', mode = { 'n', 'v' } },
{ '<leader>p', group = '[P]aste', mode = { 'v' } },
{ '<leader>pn', group = '[N]o', mode = { 'v' } },
} }
-- register which-key VISUAL mode
-- required for visual <leader>hs (hunk stage) to work
require('which-key').register({
['<leader>'] = { name = 'VISUAL <leader>' },
['<leader>h'] = { 'Git [H]unk' },
['<leader>d'] = { name = '[D]elete', _ = 'which_key_ignore' },
['<leader>p'] = { name = '[P]aste', _ = 'which_key_ignore' },
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
['<leader>dn'] = { name = '[N]o', _ = 'which_key_ignore' },
['<leader>pn'] = { name = '[N]o', _ = 'which_key_ignore' },
['<leader>l'] = { name = '[L]ist', _ = 'which_key_ignore' },
['<leader>f'] = { name = '[F]ormat/[F]ile', _ = 'which_key_ignore' },
['<leader>g'] = { name = '[G]lobal', _ = 'which_key_ignore' },
}, { mode = 'v' })
end, end,
}, },
} }

View File

@ -3,14 +3,17 @@
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
vim.fn.system { local out = vim.fn.system {
'git', 'git',
'clone', 'clone',
'--filter=blob:none', '--filter=blob:none',
'--branch=stable', '--branch=stable',
lazyrepo, 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 end ---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)