From 74858f94885c3bc9cef98a128a4710c2c2b99177 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 12 Sep 2023 12:17:08 +0200 Subject: nvim: Include more Neovim configurations --- .config/nvim/lua/mango/remap.lua | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .config/nvim/lua/mango/remap.lua (limited to '.config/nvim/lua/mango/remap.lua') diff --git a/.config/nvim/lua/mango/remap.lua b/.config/nvim/lua/mango/remap.lua new file mode 100644 index 0000000..3c4c526 --- /dev/null +++ b/.config/nvim/lua/mango/remap.lua @@ -0,0 +1,45 @@ +local function remap(modes, from, to) + modes:gsub('.', function(c) + vim.keymap.set(c, from, to) + end) +end + +vim.g.mapleader = ' ' + +-- Make adjustments for my custom keyboard layout +remap('nv', '€', '$') +remap('nv', ')', '0') +remap('n', '<', '<<') +remap('n', '>', '>>') + +-- Open netrw +remap('n', 'rw', vim.cmd.Ex) + +-- Better frame navigation +remap('n', '', 'h') +remap('n', '', 'j') +remap('n', '', 'k') +remap('n', '', 'l') + +-- I prefer visual-line mode on ‘V’ +remap('n', 'V', '') +remap('n', '', 'V') + +-- Move selections up and down +remap('v', '', ":m '>+1gv=gv") +remap('v', '', ":m '<-2gv=gv") + +-- Don’t move cursor with various commands +remap('n', 'J', 'mzJ`z') +remap('n', '', 'zz') +remap('n', '', 'zz') +remap('n', 'n', 'nzzzv') +remap('n', 'N', 'Nzzzv') + +-- Paste and delete without clobbering primary register +remap('x', 'p', '"_dP') +remap('nv', 'd', '"_d') + +-- Copy to system clipboard +remap('vn', 'y', '"+y') +remap('n', 'Y', '"+Y') -- cgit v1.2.3