commit 437a8b0eac5a043e4ae2d2b0651cd36e59fc467f Author: ShatteredMINT Date: Mon Sep 30 04:39:59 2024 +0200 basics diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..e69de29 diff --git a/plugin/keymap.lua b/plugin/keymap.lua new file mode 100644 index 0000000..6f8b237 --- /dev/null +++ b/plugin/keymap.lua @@ -0,0 +1,40 @@ +-- define common options +local opts = { + noremap = true, -- non-recursive + silent = true, -- do not show message +} +local map = vim.keymap.set + +vim.g.mapleader = ' ' +----------------- +-- Normal mode -- +----------------- + +-- Hint: see `:h vim.map.set()` +-- Better window navigation +map('n', 'wh', 'h', opts) +map('n', 'wj', 'j', opts) +map('n', 'wk', 'k', opts) +map('n', 'wl', 'l', opts) + +local step_size = 4 +map('n', 'wJ', ':resize -'.. step_size ..'', opts) +map('n', 'wK', ':resize +'.. step_size ..'', opts) +map('n', 'wH', ':vertical resize -'.. step_size ..'', opts) +map('n', 'wL', ':vertical resize +'.. step_size ..'', opts) + +map('n', 'wn', ':windo new', opts) +map('n', 'wc', ':close', opts) + +-- tab management +map('n', '', ':tabnext', opts) +map('n', 'x', ':tabclose', opts) +map('n', 's', ':$tab split', opts) + + +----------------- +-- Visual mode -- +----------------- + +--vim.keymap.set('v', '<', '', '>gv', opts) diff --git a/plugin/options.lua b/plugin/options.lua new file mode 100644 index 0000000..36246ba --- /dev/null +++ b/plugin/options.lua @@ -0,0 +1,26 @@ +-- Hint: use `:h