docs: modernize readme and vimdoc
- Update homepage URL to barrettruth.com - Replace setup() docs with vim.g.live_server config - Add luarocks installation to readme - Remove lazy.nvim specific example
This commit is contained in:
parent
4aeb022382
commit
4ee3715efa
2 changed files with 46 additions and 63 deletions
57
readme.md
57
readme.md
|
|
@ -1,53 +1,46 @@
|
|||
# live-server.nvim
|
||||
|
||||
Live reload HTML, CSS, and JavaScript files inside neovim with the power of
|
||||
Live reload HTML, CSS, and JavaScript files inside Neovim with the power of
|
||||
[live-server](https://www.npmjs.com/package/live-server).
|
||||
|
||||
## Installation
|
||||
|
||||
1. Install [live-server](https://www.npmjs.com/package/live-server) globally
|
||||
with your node.js package manager of choice.
|
||||
Install using your package manager of choice or via
|
||||
[luarocks](https://luarocks.org/modules/barrettruth/live-server.nvim):
|
||||
|
||||
2. Install regularly with your neovim package manager
|
||||
|
||||
For example, a config with [pnpm](https://pnpm.io) and
|
||||
[lazy.nvim](https://github.com/folke/lazy.nvim) may look like the following:
|
||||
|
||||
```lua
|
||||
require('lazy').setup {
|
||||
{
|
||||
'barrettruth/live-server.nvim',
|
||||
build = 'pnpm add -g live-server',
|
||||
cmd = { 'LiveServerStart', 'LiveServerStop' },
|
||||
config = true
|
||||
}
|
||||
}
|
||||
```
|
||||
luarocks install live-server.nvim
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
- [live-server](https://www.npmjs.com/package/live-server) (install globally via
|
||||
npm/pnpm/yarn)
|
||||
|
||||
## Configuration
|
||||
|
||||
Configure via the setup function (or use the defaults with no arguments):
|
||||
Configure via `vim.g.live_server` before the plugin loads:
|
||||
|
||||
```lua
|
||||
require('live-server').setup(opts)
|
||||
vim.g.live_server = {
|
||||
args = { '--port=5555' },
|
||||
}
|
||||
```
|
||||
|
||||
See `:h live-server` for more information
|
||||
See `:help live-server` for available options.
|
||||
|
||||
## Usage
|
||||
|
||||
`:LiveServerStart`: start the live server
|
||||
```vim
|
||||
:LiveServerStart [dir] " Start the server
|
||||
:LiveServerStop [dir] " Stop the server
|
||||
:LiveServerToggle [dir] " Toggle the server
|
||||
```
|
||||
|
||||
`:LiveServerStop`: stop the live server
|
||||
The server runs by default on `http://localhost:5555`.
|
||||
|
||||
## Development Server
|
||||
## Documentation
|
||||
|
||||
The server runs by default on `http://localhost:5555`. You can access your project by opening this URL in your web browser.
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
1. [mazeloth/live-server](https://github.com/manzeloth/live-server/blob/main/plugin/live-server.vim):
|
||||
the first ever live-server port to vim
|
||||
2. [aurum77/live-server.nvim](https://github.com/aurum77/live-server.nvim): the
|
||||
first live-server port to neovim (however, it unecessarily depends on `npm`
|
||||
and didn't quite cut it for me)
|
||||
```vim
|
||||
:help live-server.nvim
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue