websocket-text-relay.nvim is a Neovim plugin designed to enhance your live coding experience by leveraging the power of WebSockets and the Language Server Protocol (LSP). This tool watches for changes to your files and seamlessly relays these updates to the frontend client. With websocket-text-relay.nvim, you can see your code changes reflected live, without the need to save or refresh your browser.
This repo contains just the neovim client. The server implementation can be found in the websocket-text-relay repo
Requirements: Nodejs
First install the websocket-text-relay language server
npm install --global websocket-text-relay@latest
If you already have installed the language server, you can run the same command again to update to the latest version (just be sure to include the @latest
suffix)
websocket-text-relay.nvim can be installed using lazy.nvim.
Add the following line to your Neovim configuration to install websocket-text-relay.nvim:
require('lazy').setup {
{ 'niels4/websocket-text-relay.nvim', opts = {} }
}
Verify the plugin is working by viewing the status UI hosted at http://localhost:38378
After installation, continue with step 2 in the websocket-text-relay README to connect your editor to a front end client and see your updates rendered as you type.
By default, the http and websocket server will only accept incoming connections from your local machine. If you
wish to allow network access you must set the allow_network_access
option to true.
{ 'niels4/websocket-text-relay.nvim', opts = {
allow_network_access = true
}},
By default, the http and websocket server will only accept connections where the hostname is localhost
. If you wish
to allow other hosts to connect to the websocket server, you must explicitly allow them using the allowed_hosts
option.
{ 'niels4/websocket-text-relay.nvim', opts = {
allowed_hosts = { "some-allowed-host.test", "some-other-host.test" },
}},
You can override the command used to start the language server using the cmd
option. This is useful for local
development and debugging the application using the chrome debugger. See the develoeprs guide for more information.
local home_dir = vim.fn.resolve(os.getenv("HOME"))
require('lazy').setup {
{ 'niels4/websocket-text-relay.nvim', opts = {
cmd = { "node", "--inspect", home_dir .. "/dev/src/websocket-text-relay/start.js" }
}}
}
websocket-text-relay.nvim is released under the MIT License.