remove custom gx command in favor of netrw functionnalities and add documentation for netrw hijack

This commit is contained in:
kiyan
2021-02-21 12:27:31 +01:00
parent 894acce5ef
commit ce2420b9da
4 changed files with 14 additions and 26 deletions

View File

@@ -280,7 +280,6 @@ local function set_mappings()
[bindings.next_git_item] = 'on_keypress("next_git_item")';
[bindings.dir_up] = 'on_keypress("dir_up")';
[bindings.close] = 'on_keypress("close")';
gx = "xdg_open()";
}
for k,v in pairs(mappings) do

View File

@@ -196,25 +196,6 @@ function M.reset_highlight()
renderer.render_hl(lib.Tree.bufnr)
end
function M.xdg_open()
local node = lib.get_node_at_cursor()
-- TODO: this should open symlink targets
if not node or node.entries or node.link_to then return end
local cmd
if vim.fn.has('unix') == 1 then
cmd = 'xdg-open'
else
cmd = 'open'
end
vim.loop.spawn(cmd, {args={node.absolute_path}}, vim.schedule_wrap(function(code)
if code ~= 0 then
api.nvim_err_writeln("Could not open "..node.absolute_path)
end
end))
end
colors.setup()
vim.defer_fn(M.on_enter, 1)