feat(vim.ui): vim.ui.open, "gx" without netrw

Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: ii14 <59243201+ii14@users.noreply.github.com>
This commit is contained in:
marshmallow
2023-04-30 15:53:02 +10:00
committed by Justin M. Keyes
parent 3ecd45ded0
commit af6e6ccf3d
6 changed files with 115 additions and 11 deletions

View File

@@ -18,3 +18,11 @@ vim.api.nvim_create_user_command('InspectTree', function(cmd)
vim.treesitter.inspect_tree()
end
end, { desc = 'Inspect treesitter language tree for buffer', count = true })
if vim.g.use_lua_gx == nil or vim.g.use_lua_gx == true then
vim.keymap.set({ 'n', 'x' }, 'gx', function()
local uri = vim.fn.expand('<cfile>')
vim.ui.open(uri)
end, { desc = 'Open URI under cursor with system app' })
end