local map = require 'std.map' local const = require 'std.const' local togglers = require 'bugabinga.options.togglers' -- set as leader key map { keys = '', command = '', } vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- disable them evil arrows map { keys = '', command = '', } map { keys = '', command = '', } map { keys = '', command = '', } map { keys = '', command = '', } map.normal { description = 'Dismiss current search highlight', category = 'search', keys = '', command = vim.cmd.nohlsearch } map.normal { description = 'Source current file', category = 'vim', keys = 'xx', command = function() vim.cmd.source '%' vim.notify('Sourcing current file...') end, } map.normal { description = 'Toggle dark/light theme variant', category = 'ui', keys = 'tt', command = function() if vim.opt.background:get() == 'dark' then vim.opt.background = 'light' else vim.opt.background = 'dark' end vim.notify('Toggled background to ' .. vim.opt.background:get() .. '.') end, } map.normal { description = 'Redo undone operation', category = 'history', keys = 'U', command = vim.cmd.redo, } for _, toggler in ipairs(togglers) do local option_name = toggler.options[1].name local first_char = string.sub(option_name, 1, 1) map.normal { description = 'Toggle ' .. option_name .. ' option', category = 'options', keys = 't' .. first_char, command = function() toggler:toggle() end, } end