16 lines
512 B
Lua
16 lines
512 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.edit_cf('h', '/lua/helpers.lua')
|
|
|
|
return helpers
|
|
-- nnoremap <Leader>ev :tabedit $MYVIMRC<CR>
|