mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-25 21:01:45 +00:00
global cmd with capture group yank
This commit is contained in:
parent
db73a4653f
commit
216d892c17
@ -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>-')
|
||||
|
||||
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
|
||||
-- System clipboard keybinds in normal and visual mode
|
||||
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>s'] = { name = '[S]earch', _ = '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>c'] = { name = '[C]ode/[C]odeium/[C]hange', _ = '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>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,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user