aboutsummaryrefslogtreecommitdiff
path: root/runtime/plugin/nvim.lua
diff options
context:
space:
mode:
authormarshmallow <marshycity@gmail.com>2023-04-30 15:53:02 +1000
committerJustin M. Keyes <justinkz@gmail.com>2023-07-04 23:45:00 +0200
commitaf6e6ccf3dee815850639ec5613dda3442caa7d6 (patch)
tree8425b2b0dcf6592dd5f8a25d63187f337a047a2e /runtime/plugin/nvim.lua
parent3ecd45ded044c47efa76b74e9e3b720fbe27adc7 (diff)
downloadrneovim-af6e6ccf3dee815850639ec5613dda3442caa7d6.tar.gz
rneovim-af6e6ccf3dee815850639ec5613dda3442caa7d6.tar.bz2
rneovim-af6e6ccf3dee815850639ec5613dda3442caa7d6.zip
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>
Diffstat (limited to 'runtime/plugin/nvim.lua')
-rw-r--r--runtime/plugin/nvim.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/plugin/nvim.lua b/runtime/plugin/nvim.lua
index 0a33826b82..fcc1b016aa 100644
--- a/runtime/plugin/nvim.lua
+++ b/runtime/plugin/nvim.lua
@@ -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