add Primeagen's remaps

This commit is contained in:
Schistos Tega 2024-06-02 19:30:09 +03:00
parent 1b20ada075
commit b15c51b398
1 changed files with 20 additions and 0 deletions

View File

@ -46,3 +46,23 @@ vim.keymap.set('n', '<leader>ys', function()
end
end)
end, { desc = '[Y]ank [S]elector' })
-- https://github.com/ThePrimeagen/init.lua/blob/master/lua/theprimeagen/remap.lua
-- https://youtu.be/w7i4amO_zaE?si=bRJDSVlL_vvFwmxh
-- move visually selected block upward or downward
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv")
-- hold cursor in place while joining lines
vim.keymap.set('n', 'J', 'mzJ`z')
-- hold cursor in the middle while scrolling half of a page
vim.keymap.set('n', '<C-d>', '<C-d>zz')
vim.keymap.set('n', '<C-u>', '<C-u>zz')
-- hold cursor in the middle while navigation throgh search
vim.keymap.set('n', 'n', 'nzzzv')
vim.keymap.set('n', 'N', 'Nzzzv')
vim.keymap.set('x', '<leader>p', [["_dP]], { desc = '[P]aste and keep the copy buffer' })
vim.keymap.set('n', '<leader>rc', [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], { desc = '[R]ename [C]urrent word' })