-- Global bindings -- NOTE: A binding MUST only use neovim features to be loaded here. -- Any plugin bindings MUST be declared WITH the plugin config. -- This is to ensure plugins are loaded before binding anything -- IMPORTANT: ALL keymaps MUST set the desc attribute -- It is advisable that where possible the keybinds call lua functions -- this is to make things easier to expand later local map = vim.keymap.set map('n', 'o', function () vim.o.spell = not vim.o.spell end , {desc = "Toggle Spelling"} ) local function ModHeight(inc) local win = vim.api.nvim_get_current_win() local height = vim.api.nvim_win_get_height(win) if inc then height = height + 1 else height = height - 1 end end local function ModWidth(inc) local win = vim.api.nvim_get_current_win() local width = vim.api.nvim_win_get_width(win) if inc then width = width + 1 else width = width - 1 end vim.api.nvim_win_set_width(win,width) end map('n', 'H', function() ModWidth(false) end, {desc = "Decrease Width"}) map('n', 'J', function() ModHeight(false) end, {desc = "Decrease Height"}) map('n', 'K', function() ModHeight(true) end, {desc = "Increase Height"}) map('n', 'L', function() ModWidth(true) end, {desc = "Increase Width"}) map('n', '', function() vim.cmd.wincmd("h") end, {desc = "Change window "}) map('n', '', function() vim.cmd.wincmd("j") end, {desc = "Change window "}) map('n', '', function() vim.cmd.wincmd("k") end, {desc = "Change Window "}) map('n', '', function() vim.cmd.wincmd("l") end, {desc = "Change Window "})