Files
nvim/lua/helpers.lua
2025-07-24 14:27:38 +01:00

21 lines
630 B
Lua

local helpers = {}
--- Creates a keymap to edit a certain config file
--- @param map string the keys that follow <Leader>e
--- @param path string the relative path from the config root
helpers.edit_cf = function(map, path)
vim.keymap.set('n', '<Leader>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 <Leader>ev :tabedit $MYVIMRC<CR>