Skip to content

Instantly share code, notes, and snippets.

@markscottwright
Created September 21, 2022 15:21
Show Gist options
  • Save markscottwright/94e8535e9860a14ce2ebbe30408c5225 to your computer and use it in GitHub Desktop.
Save markscottwright/94e8535e9860a14ce2ebbe30408c5225 to your computer and use it in GitHub Desktop.
How to open the current file/line in github from Vim
fun! GithubOpen()
let olddir = getcwd()
call chdir(expand('%:p:h'))
silent! execute "!gh browse " . shellescape(expand('%')) . ":" . line('.')
redraw!
call chdir(olddir)
endfun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment