Skip to content

Is there a shortcut for open a URL in the current cell? #1543

Answered by geekscrapy
reagle asked this question in Q&A
Discussion options

You must be logged in to vote

For the command palette, try z ctrl+H

For opening a URL, you might want zo to open the URL with vd, or if you want to open with the OS command try the below in your .visidatarc

@VisiData.global_api
def sys_open_resource(vd, resource):
  import subprocess, os, platform
  if platform.system() == 'Darwin':       # macOS
      subprocess.call(('open', resource))
  elif platform.system() == 'Windows':    # Windows
      os.startfile(resource)
  else:                                   # linux variants
      subprocess.call(('xdg-open', resource))

# Generic OS open
Sheet.addCommand(None, 'sysopen-cell', 'sys_open_resource(cursorValue)', 'Open cell with OS')

Hope that helps!

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@reagle
Comment options

@saulpw
Comment options

@frosencrantz
Comment options

Answer selected by reagle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants