Open Source Code in Browser - VSCode Extension
Quickly open source code for the current file or folder in the browser.
This is a little something I wished for at work! Whenever I wanted to look at the pretty diff of my code in the browser, I had to right click > copy path > open browser > append path to URL, and I thought it would be so nice to have a keyboard shortcut for that.
Initial setup + opening file
Opening file from sidebar
Commands
- Open source code in browser
- Edit repo root URL
Run it from
- Command palette (
ctrl
/cmd
+shift
+p
orView
>Command Palette...
) - Context menu (right click in Explorer sidebar or on a file)
ctrl
+alt
+g
Extension settings
openSrcInBrowser.rootURL
: URL where the repository root is found (ex. https://github.com/maggiey22/discord-dad-bot).
Made with
Future plans
- Open on specific line number
- Open multiple at once
- Publish to VSCode Marketplace!
Try it!
- Download
open-src-code-in-browser-0.0.1.vsix
and install in VSCode > Extensions sidebar > ... > Install from VSIX...
Happy coding!