How do I set up Visual Studio Code and my browser side by side

Just starting out using Visual Studio Code. I can have the browser in a preview, but I want to have the browser linked instead.
I’m using a Mac.
I tried dragging the new browser page next, but that does not work as they do not connect.
What else can I do?

Answer

I am guessing you mean you want your browser side by side next to the VSCode app. You can copy the absolute file path(I think it is just called ‘Copy Path’) of the html file and paste the path in the browser.

Or you can do as Andre Sampaio said and download Live Server extension on VSCode. The extension updates your codes in the browser every time you save in VSCode. After you download the extension through the extension tab in VSCode, you right-click(or control + click) and click ‘Open with Live Server’ in the HTML file.


Another solution for Live-Server

  1. Go to https://nodejs.org/en/ and download Node.js for your Mac
  2. Go to VSCode and press ‘Control + ~` and it will open up the terminal inside VSCode
  3. Type in sudo npm install live-server -g
  4. Enter your password
  5. Type in live-server in Terminal and the file should pop up on the browser

In the future, all you have to do is type in live-server in VSCode’s Terminal. The node won’t disappear unless you kill the active Terminal instance by clicking on the trash can in VSCode’s Terminal

Leave a Reply

Your email address will not be published. Required fields are marked *