feat(remap.lua): add keymap for selecting all text with "<leader>a" shortcut

The change adds a new keymap in the remap.lua file to select all text in the editor when the "<leader>a" shortcut is pressed. This allows users to quickly select the entire document without manually scrolling or using other selection methods.
This commit is contained in:
David Ibia
2024-01-30 16:05:54 +01:00
parent 4bc3130791
commit 246291ed8c

View File

@@ -3,6 +3,9 @@ local opts = { noremap = true, silent = true }
opts.desc = "Show Cheatsheet" opts.desc = "Show Cheatsheet"
vim.keymap.set("n", "<leader>\\", "<cmd>Cheatsheet<CR>", opts) -- toggle file explorer vim.keymap.set("n", "<leader>\\", "<cmd>Cheatsheet<CR>", opts) -- toggle file explorer
opts.desc = "Select All"
vim.keymap.set("n", "<leader>a", "gg0vG$", opts) -- select all
-- Move selected line / block of text in visual mode up -- Move selected line / block of text in visual mode up
opts.desc = "Move selected line / block of text in visual mode up" opts.desc = "Move selected line / block of text in visual mode up"
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", opts) vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", opts)