This commit is contained in:
Ray Elliott 2025-12-07 19:05:18 +00:00
parent b247db8531
commit 9d10df7ed5
2 changed files with 10 additions and 3 deletions

View File

@ -42,8 +42,15 @@ end, { desc = 'Hover (LSP)', silent = true })
-- Netrw file explorer keymaps
-- Open netrw in new tab at current file's directory
map('n', '<leader>te', function()
local current_file_dir = vim.fn.expand('%:p:h')
vim.cmd('tabnew')
vim.cmd('Explore ' .. vim.fn.expand('%:p:h'))
end, { desc = 'Tab explore (netrw in new tab)', silent = true })
vim.cmd('Explore ' .. vim.fn.fnameescape(current_file_dir))
end, { desc = 'Tab explore (current file dir)', silent = true })
-- Open netrw in new tab at project root (cwd)
map('n', '<leader>tE', function()
vim.cmd('tabnew')
vim.cmd('Explore ' .. vim.fn.fnameescape(vim.fn.getcwd()))
end, { desc = 'Tab explore (project root)', silent = true })
return {}

View File

@ -29,4 +29,4 @@ vim.opt.listchars = {
-- Enable line numbers and relative line numbers
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.relativenumber = true