Files
nvim/lua/helpers.lua

21 lines
630 B
Lua
Raw Normal View History

2025-04-12 23:49:02 +01:00
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
2025-07-24 14:27:38 +01:00
helpers.map = function(keys, func, opts, mode)
mode = mode or 'n'
vim.keymap.set(mode, keys, func, opts)
end
2025-04-12 23:49:02 +01:00
helpers.edit_cf('h', '/lua/helpers.lua')
return helpers
-- nnoremap <Leader>ev :tabedit $MYVIMRC<CR>