feat: add some custom keymaps
All checks were successful
Container build / container-build (push) Successful in 3m28s
All checks were successful
Container build / container-build (push) Successful in 3m28s
This commit is contained in:
parent
702687276a
commit
fc68b611fe
@ -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 ===
|
||||
|
23
config/nvim/config/keymaps.lua
Normal file
23
config/nvim/config/keymaps.lua
Normal 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)
|
@ -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" })
|
Loading…
Reference in New Issue
Block a user