Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend existing increment/decrement keymaps.lua #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .config/nvim/lua/josean/core/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ keymap.set("i", "jk", "<ESC>", { desc = "Exit insert mode with jk" })
keymap.set("n", "<leader>nh", ":nohl<CR>", { desc = "Clear search highlights" })

-- increment/decrement numbers
keymap.set("n", "<leader>+", "<C-a>", { desc = "Increment number" }) -- increment
keymap.set("n", "<leader>-", "<C-x>", { desc = "Decrement number" }) -- decrement
keymap.set({ "n", "x" }, "<leader>+", "<C-a>", { desc = "Increment number" }) -- increment
keymap.set({ "n", "x" }, "<leader>-", "<C-x>", { desc = "Decrement number" }) -- decrement
-- increment/decrement numbers sequentially across multiple lines ("0\n0\n0" -> "1\n2\n3")
keymap.set("x", "g+", "g<C-a>", { desc = "Increment numbers sequentially" })
keymap.set("x", "g-", "g<C-x>", { desc = "Decrement numbers sequentially" })

-- window management
keymap.set("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically
Expand Down