-- Open files relative to the directory the current file lives in
vim.api.nvim_set_keymap(
'n',
'ce',
':e =expand("%:p:h") . "/"',
{ desc = '[e]dit a file in the [c]urrent files directory', noremap = true, silent = true }
)
vim.api.nvim_set_keymap(
'n',
'ct',
':tabe =expand("%:p:h") . "/"',
{ desc = 'open a new [t]ab of a file in the [c]urrent files directory', noremap = true, silent = true }
)
vim.api.nvim_set_keymap(
'n',
'cs',
':split =expand("%:p:h") . "/"',
{ desc = 'open a [s]plit of a file in the [c]urrent files directory', noremap = true, silent = true }
)
vim.api.nvim_set_keymap(
'n',
'cv',
':vsplit =expand("%:p:h") . "/"',
{ desc = 'open a [v]ertical split of a file in the [c]urrent files directory', noremap = true, silent = true }
)