mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-11-15 05:23:50 +00:00
global cmd with capture group yank
This commit is contained in:
parent
cacb564101
commit
c240529edd
@ -61,6 +61,18 @@ vim.keymap.set({ 'n', 'v' }, '<M-.>', '<C-W>>')
|
|||||||
vim.keymap.set({ 'n', 'v' }, '<M-=>', '<C-W>+')
|
vim.keymap.set({ 'n', 'v' }, '<M-=>', '<C-W>+')
|
||||||
vim.keymap.set({ 'n', 'v' }, '<M-->', '<C-W>-')
|
vim.keymap.set({ 'n', 'v' }, '<M-->', '<C-W>-')
|
||||||
|
|
||||||
|
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' }, '<leader>gy', global_cmd_yank, { desc = '[G]lobal command [Y]ank' })
|
||||||
|
|
||||||
if vim.g.neovide then
|
if vim.g.neovide then
|
||||||
-- System clipboard keybinds in normal and visual mode
|
-- System clipboard keybinds in normal and visual mode
|
||||||
vim.keymap.set({ 'n', 'v' }, '<C-S-c>', '"+y', { desc = 'Yank to System clipboard' })
|
vim.keymap.set({ 'n', 'v' }, '<C-S-c>', '"+y', { desc = 'Yank to System clipboard' })
|
||||||
|
@ -25,7 +25,7 @@ return {
|
|||||||
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
||||||
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
||||||
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
||||||
['<leader>g'] = { name = '[G]it', _ = 'which_key_ignore' },
|
['<leader>g'] = { name = '[G]it/[G]lobal', _ = 'which_key_ignore' },
|
||||||
['<leader>b'] = { name = '[B]uffer/[B]reakpoint', _ = 'which_key_ignore' },
|
['<leader>b'] = { name = '[B]uffer/[B]reakpoint', _ = 'which_key_ignore' },
|
||||||
['<leader>c'] = { name = '[C]ode/[C]odeium/[C]hange', _ = 'which_key_ignore' },
|
['<leader>c'] = { name = '[C]ode/[C]odeium/[C]hange', _ = 'which_key_ignore' },
|
||||||
['<leader>cd'] = { name = '[D]irectory', _ = 'which_key_ignore' },
|
['<leader>cd'] = { name = '[D]irectory', _ = 'which_key_ignore' },
|
||||||
@ -50,6 +50,7 @@ return {
|
|||||||
['<leader>pn'] = { name = '[N]o', _ = 'which_key_ignore' },
|
['<leader>pn'] = { name = '[N]o', _ = 'which_key_ignore' },
|
||||||
['<leader>l'] = { name = '[L]ist', _ = 'which_key_ignore' },
|
['<leader>l'] = { name = '[L]ist', _ = 'which_key_ignore' },
|
||||||
['<leader>f'] = { name = '[F]ormat/[F]ile', _ = 'which_key_ignore' },
|
['<leader>f'] = { name = '[F]ormat/[F]ile', _ = 'which_key_ignore' },
|
||||||
|
['<leader>g'] = { name = '[G]lobal', _ = 'which_key_ignore' },
|
||||||
}, { mode = 'v' })
|
}, { mode = 'v' })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user