feat: add some custom keymaps
All checks were successful
Container build / container-build (push) Successful in 3m28s

This commit is contained in:
Job
2024-11-06 20:03:57 +01:00
parent 702687276a
commit fc68b611fe
3 changed files with 24 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
local keymap = vim.keymap.set
local delkeymap = vim.keymap.del
local opts = { noremap = true, silent = true }
-- Better line start/end
keymap("n", "H", "^", opts)
keymap("n", "L", "$", opts)
keymap("v", "H", "^", opts)
keymap("v", "L", "$", opts)
-- Better escape
keymap("n", "<ESC>", "s<ESC>:noh<CR>", opts)
-- Disable alt j/k to move lines
delkeymap({ "i", "v" }, "<A-j>")
delkeymap({ "i", "v" }, "<A-k>")
-- Better <ctrl> + movement
keymap("n", "<C-d>", "<C-d>zz", opts)
keymap("n", "<C-u>", "<C-u>zz", opts)

View File

@@ -1,2 +0,0 @@
vim.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Center cursor after moving down half-page" })
vim.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Center cursor after moving up half-page" })