open url based on OS
This commit is contained in:
parent
6cf21bf121
commit
d8dc7e067c
3 changed files with 22 additions and 3 deletions
|
|
@ -5,8 +5,15 @@ if not ok then
|
|||
end
|
||||
|
||||
local list = require 'telescope._extensions.http.list'
|
||||
local osname = require 'telescope._extensions.getOS'
|
||||
|
||||
local default_opts = { open_url = 'xdg-open %s' }
|
||||
local open_url_os = {
|
||||
['OSX'] = { open_url = 'open %s' },
|
||||
['Windows'] = { open_url = 'start %s' },
|
||||
}
|
||||
|
||||
local default_opts = open_url_os[osname()]
|
||||
if not default_opts then default_opts = { open_url = 'xdg-open %s' } end
|
||||
local opts = {}
|
||||
|
||||
return telescope.register_extension {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue