1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00

nvim: keymaps: adding paste mappings

This commit is contained in:
Henrik Hautakoski 2024-09-05 21:11:06 +02:00
parent ef2e3a7fc4
commit 45c8e094a2

View file

@ -36,8 +36,16 @@ vim.keymap.set('x', '<leader>fhn', [[:s/\(\(0x\x\{1,2\}, \)\{8\}\)/\1\r/g]], { d
vim.keymap.set("x", "<leader>fcsc", [[:s/\%V\([a-z]\+\)_\?/\u\1/g]],
{ desc = "Convert text from snake_case to CamelCase" })
--
-- Editing - Copy / Paste
--
-- copy/paste
-- Maintain the cursor position when yanking a visual selection.
vim.keymap.set('v', 'y', 'myy`y')
vim.keymap.set('v', 'Y', 'myY`y')
-- Indent and move to the end when pasting.
vim.keymap.set('n', 'p', 'p`[v`]=`>')
vim.keymap.set({ 'n', 'v' }, '<leader>y', [["+y]], {})
vim.keymap.set({ 'n', 'v' }, '<leader>p', [["+p]], {})