Merge branch 'dev' into mercury

nvim: smart pasting in visual-mode
        add description to <C-E>
        fix comments and formatting
        set keymaps for visual-mode only
        keymap to send selection to void register
This commit is contained in:
David JULIEN 2023-01-07 22:31:42 +01:00
commit 3895178aca
Signed by: swytch
GPG Key ID: 498590A3AA82A06F

View File

@ -11,7 +11,7 @@ vim.keymap.set({ "n", "v" }, "<space>",
})
vim.g.mapleader = " "
-- Dealing with word wrap
-- dealing with word wrap
vim.keymap.set("n", "k",
"v:count == 0 ? 'gk' : 'k'",
{
@ -27,21 +27,36 @@ vim.keymap.set("n", "j",
desc = "Smart down motion"
})
vim.keymap.set("n", "<leader>y",
-- yank and pasting
vim.keymap.set({ "n", "x" }, "<leader>y",
"\"+y",
{ desc = "Yank to clipboard"}
)
vim.keymap.set("n", "<leader>p",
"\"+P",
{ desc = "Copy from clipboard"}
{ desc = "Paste from clipboard" }
)
vim.keymap.set("x", "<leader>p",
"\"_dP",
{ desc = "Send selection to void register and paste from clipboard" }
)
-- deletion
vim.keymap.set({ "n", "x" }, "<leader>d",
"\"_d",
{ desc = "Send selection to void register" }
)
-- comfort zone
vim.keymap.set("n", "<leader><enter>",
"<cmd>w! | !compiler %<CR>",
{ desc = "Compile current file using ~/.local/bin/compiler"}
{ desc = "Compile current file using ~/.local/bin/compiler" }
)
-- packer
vim.keymap.set("n", "<leader>u",
function() require("packer").sync() end,
{ desc = "Sync packer config and update plugins"}
{ desc = "Sync packer config and update plugins" }
)
-- telescope
@ -77,4 +92,6 @@ vim.keymap.set("n", "<leader>s",
)
-- snippets
vim.keymap.set({ "i", "s" }, "<C-E>", "<Plug>luasnip-next-choice")
vim.keymap.set({ "i", "s" }, "<C-E>", "<Plug>luasnip-next-choice",
{ desc = "Cycle through luasnip choices" }
)