local helpers = {} --- Creates a keymap to edit a certain config file --- @param map string the keys that follow e --- @param path string the relative path from the config root helpers.edit_cf = function(map, path) vim.keymap.set('n', 'e' .. map, function() vim.cmd('tabedit ' .. vim.fn.stdpath 'config' .. '/' .. path) end, { desc = 'Edit ' .. path .. ' in a new tab' }) end helpers.map = function(keys, func, opts, mode) mode = mode or 'n' vim.keymap.set(mode, keys, func, opts) end helpers.edit_cf('h', '/lua/helpers.lua') return helpers -- nnoremap ev :tabedit $MYVIMRC