Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live-Server should open the current file rather than index.html #4

Open
pkradiator opened this issue Aug 9, 2024 · 2 comments
Open

Comments

@pkradiator
Copy link

pkradiator commented Aug 9, 2024

Suppose you have two files in your cwd , index.html and about.html. If you have about.html open in vim and you run :StartLiveServer it should check if the file in the current buffer is in html file and if so then it should open it rather than opening index.html.

@wolandark
Copy link
Owner

That can be done with adding the --open= arg to live-server.
In vimscript it should be enough to add bufname() to the cmd.

Such as let cmd = "live-server --open=" . bufname() . "&".

I will probably add this in the near future. But in the meanwhile, if it is a must, you can edit the source as above.

@pkradiator
Copy link
Author

Thanks. It works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants