From 437a8b0eac5a043e4ae2d2b0651cd36e59fc467f Mon Sep 17 00:00:00 2001 From: ShatteredMINT Date: Mon, 30 Sep 2024 04:39:59 +0200 Subject: [PATCH] basics --- init.lua | 0 plugin/keymap.lua | 40 ++++++++++++++++++++++++++++++++++++++++ plugin/options.lua | 26 ++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 init.lua create mode 100644 plugin/keymap.lua create mode 100644 plugin/options.lua 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