aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-09-16 03:21:40 -0700
committerGitHub <noreply@github.com>2024-09-16 03:21:40 -0700
commit549c00c791d2574298d3c98ceb3e5ee40acc532f (patch)
tree5050984d1e0335854712d0178f42991e4eaae2c3 /runtime/doc
parenta9031cc4a649f6ad5ef3db29a9bf52468332bcde (diff)
parent23dcd7cd73dc19212befcdbbc06ddf80db082ec4 (diff)
downloadrneovim-549c00c791d2574298d3c98ceb3e5ee40acc532f.tar.gz
rneovim-549c00c791d2574298d3c98ceb3e5ee40acc532f.tar.bz2
rneovim-549c00c791d2574298d3c98ceb3e5ee40acc532f.zip
Merge #29490 feat(vim.ui.open): configurable opener
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/lua.txt6
-rw-r--r--runtime/doc/news.txt5
2 files changed, 9 insertions, 2 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 0beee1507a..1283aac5ca 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2559,7 +2559,7 @@ vim.ui.input({opts}, {on_confirm}) *vim.ui.input()*
typed (it might be an empty string if nothing was
entered), or `nil` if the user aborted the dialog.
-vim.ui.open({path}) *vim.ui.open()*
+vim.ui.open({path}, {opt}) *vim.ui.open()*
Opens `path` with the system default handler (macOS `open`, Windows
`explorer.exe`, Linux `xdg-open`, …), or returns (but does not show) an
error message on failure.
@@ -2570,6 +2570,8 @@ vim.ui.open({path}) *vim.ui.open()*
-- Asynchronous.
vim.ui.open("https://neovim.io/")
vim.ui.open("~/path/to/file")
+ -- Use the "osurl" command to handle the path or URL.
+ vim.ui.open("gh#neovim/neovim!29490", { cmd = { 'osurl' } })
-- Synchronous (wait until the process exits).
local cmd, err = vim.ui.open("$VIMRUNTIME")
if cmd then
@@ -2579,6 +2581,8 @@ vim.ui.open({path}) *vim.ui.open()*
Parameters: ~
• {path} (`string`) Path or URL to open
+ • {opt} (`{ cmd?: string[] }?`) Options
+ • cmd string[]|nil Command used to open the path or URL.
Return (multiple): ~
(`vim.SystemObj?`) Command object, or nil if not found.
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 5884659ab7..515aef753d 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -194,7 +194,10 @@ TUI
UI
-• TODO
+• |vim.ui.open()| (by default bound to |gx|) accepts an `opt.cmd` parameter
+ which controls the tool used to open the given path or URL. If you want to
+ globally set this, you can override vim.ui.open using the same approach
+ described at |vim.paste()|.
==============================================================================
CHANGED FEATURES *news-changed*