aurum77 / live-server.nvim

A plugin to integrate live-server from Neovim
GNU General Public License v3.0
44 stars 2 forks source link

Opening the file that is being edited directly #3

Open stepanzak opened 1 year ago

stepanzak commented 1 year ago

Hi, when I use VSCode's LiveServer extension and start LiveServer while editing an HTML file, it opens that particular HTML file in a browser. However, when I'm editing an HTML file in NeoVim and run :LiveServer, it opens up my home directory in the LiveServer folder view. Is that a bug or not implemented? Or am I doing something wrong? I'm a Neovim newbie, so sorry if this is my mistake.

aurum77 commented 1 year ago

hello there, sorry for the late response. I did some testing with vscode live-server extension. If the filename is not index.html, It opens the file by inserting the name into the uri like (localhost:1234/foo.html). If you're storing the file you want to view on your home directory, you can click on the file you want to view it from the directory view (which will open up localhost:1234/foo.html) which is the same thing that vscode does. Also i would recommend not broadcasting your whole home directory on your network and instead doing your stuff in a separate folder.