diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 3687564..7810fe6 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -61,6 +61,18 @@ vim.keymap.set({ 'n', 'v' }, '', '>') vim.keymap.set({ 'n', 'v' }, '', '+') vim.keymap.set({ 'n', 'v' }, '', '-') +local function global_cmd_yank() + -- Get the (selected) lines + local lines = nil + local mode = vim.api.nvim_get_mode()['mode'] + if string.find(mode:lower(), '^v') then + else + lines = vim.api.nvim_buf_get_lines(0, 0, -1, false) + end +end + +vim.keymap.set({ 'n', 'v' }, 'gy', global_cmd_yank, { desc = '[G]lobal command [Y]ank' }) + if vim.g.neovide then -- System clipboard keybinds in normal and visual mode vim.keymap.set({ 'n', 'v' }, '', '"+y', { desc = 'Yank to System clipboard' }) diff --git a/lua/kickstart/plugins/which-key.lua b/lua/kickstart/plugins/which-key.lua index fd16c2c..0a1dd47 100644 --- a/lua/kickstart/plugins/which-key.lua +++ b/lua/kickstart/plugins/which-key.lua @@ -25,7 +25,7 @@ return { ['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', _ = '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' }, @@ -50,6 +50,7 @@ return { ['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, },