Skip to content

Commit

Permalink
feat(map): mappings to put the cursor on same position while pasting
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnwriter committed Nov 3, 2024
1 parent e1bf8a7 commit f1582e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ M.general = function()
map("i", "<C-h>", "<Left>")
map("i", "<C-j>", "<Down>")
map("i", "<C-k>", "<Up>")

map("n", "p", function()
local row, col = unpack(vim.api.nvim_win_get_cursor(0))
vim.cmd('put')
vim.api.nvim_win_set_cursor(0, { row + 1, col })
end, "Paste in same cursor")

map("i", "<C-l>", "<Right>")
map("i", "jj", "<esc>")
map("n", "<C-c>", "<cmd>noh<CR>")
Expand Down

0 comments on commit f1582e6

Please sign in to comment.