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
Signed by: Job79
SSH Key Fingerprint: SHA256:BezbKv3jZaqu7SdNrZM0e42b8nlNwh63zaVj/pUxc7U
3 changed files with 24 additions and 3 deletions

View File

@ -15,7 +15,7 @@ COPY config/user/profile /home/user/.bash_profile
# === setup neovim ===
RUN git clone --depth 1 https://github.com/LazyVim/starter ~/.config/nvim
COPY --chown=user:user config/nvim/plugins /home/user/.config/nvim/lua/plugins
COPY --chown=user:user config/nvim/config/options.lua /home/user/.config/nvim/lua/config/options.lua
COPY --chown=user:user config/nvim/config/keymaps.lua /home/user/.config/nvim/lua/config/keymaps.lua
COPY --chown=user:user config/nvim/lazyvim.json /home/user/.config/nvim/lazyvim.json
# === setup container ===

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" })