feat: move :Reveal to a plugin

This commit is contained in:
Garrett Dawson 2023-04-16 01:23:30 -06:00
parent 48db037cfc
commit 7e978b24fc
3 changed files with 31 additions and 28 deletions

View file

@ -1,21 +1,9 @@
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 {
{
"killtheliterate/nvim-reveal",
dev = false,
config = function()
require('nvim-reveal').setup {}
end
},
}