Created
September 21, 2022 15:21
-
-
Save markscottwright/94e8535e9860a14ce2ebbe30408c5225 to your computer and use it in GitHub Desktop.
How to open the current file/line in github from Vim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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