From fee75c2c4634d65d8d300693afdddd348824a4b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Fri, 22 Dec 2023 10:32:00 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20config(nvim):=20add=20and?= =?UTF-8?q?=20comment=20some=20keymaps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/nvim/lua/config/keymaps.lua | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 5648be2e..35160628 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -4,6 +4,7 @@ local map = vim.keymap.set local Util = require("lazyvim.util") +-- Google current word -- ╭───────────────────────────────────────────────────────────╮ -- │ Credit: June Gunn ?/! | Google it / Feeling lucky │ -- ╰───────────────────────────────────────────────────────────╯ @@ -27,18 +28,32 @@ map("x", "?", function() google(vim.fn.getreg("g"), false) end, { desc = "Google" }) +-- Toggle background map("n", "uB", function() Util.toggle("background", false, { "light", "dark" }) end, { desc = "Toggle Background" }) +-- Disable lazyterminal keymap map("n", "fT", "") +-- End of the word backwards +map("n", "E", "ge") + +-- Increment/decrement +map("n", "+", "") +map("n", "-", "") + +-- Tabs +map("n", "", "tabnext", { desc = "Next Tab" }) +map("n", "", "tabprevious", { desc = "Previous Tab" }) + -- Center the screen automatically map("n", "", "zz") map("n", "", "zz") map("n", "n", "nzzzv") map("n", "N", "Nzzzv") +-- Toggle statusline map("n", "uS", function() if vim.opt.laststatus:get() == 0 then vim.opt.laststatus = 3 @@ -47,10 +62,13 @@ map("n", "uS", function() end end, { desc = "Toggle Statusline" }) +-- Plugin Info map("n", "cif", "LazyFormatInfo", { desc = "Formatting" }) +map("n", "cic", "ConformInfo", { desc = "Conform" }) map("n", "cir", "LazyRoot", { desc = "Root" }) map("n", "cie", "LazyExtras", { desc = "Extras" }) +-- Move to beginning/end of line map("n", "", "_", { desc = "First character of Line" }) map("n", "", "$", { desc = "Last character of Line" }) @@ -73,8 +91,6 @@ map("n", "dd", function() end end, { noremap = true, expr = true, desc = "Don't yank empty line to clipboard" }) -map("n", "gV", '"`[" . strpart(getregtype(), 0, 1) . "`]"', { expr = true, desc = "Visually select changed text" }) - -- Search inside visually highlighted text. Use `silent = false` for it to -- make effect immediately. map("x", "g/", "/\\%V", { silent = false, desc = "Search inside visual selection" })