You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kickstart.nvim/lua/custom/plugins/reveal.lua

22 lines
539 B
Lua

vim.api.nvim_create_user_command('Reveal',
function()
-- local sysname = vim.loop.os_uname().sysname
local currentBuffer = vim.api.nvim_get_current_buf()
local bufName = vim.api.nvim_buf_get_name(currentBuffer)
local ftype = vim.fn.getftype(bufName)
if ftype == "dir" then
os.execute("xdg-open " .. bufName)
else
os.execute("xdg-open " .. vim.fn.expand("%:p:h"))
end
end,
{}
)
vim.keymap.set('n', '<leader>R', ":Reveal<CR>", { noremap = true, desc = '[R]eveal with xdg-open' })
return {
}