Home

Awesome

Live Share Plugin for Neovim

total lines GitHub code size in bytes GitHub repo size

<a href="https://dotfyle.com/plugins/azratul/live-share.nvim"> <img src="https://dotfyle.com/plugins/azratul/live-share.nvim/shield?style=flat-square" /> </a>

Overview

This plugin creates a "Live Share" server in Neovim, similar to the Visual Studio Code Live Share functionality. It relies heavily on another plugin called jbyuki/instant.nvim and reverse tunneling services like serveo.net and localhost.run.

Note: This plugin is designed to work exclusively between Neovim instances and is not compatible with Visual Studio Code Live Share sessions.

Requirements

Installation

Using Packer

use {
  'azratul/live-share.nvim',
  requires = {'jbyuki/instant.nvim'}
}

Using Vim-Plug

Plug 'azratul/live-share.nvim'
Plug 'jbyuki/instant.nvim'

Using Lazy

{
  "azratul/live-share.nvim",
  dependencies = {
    "jbyuki/instant.nvim",
  }
}

Usage

Commands

After starting the server, wait for the message indicating the URL has been copied. This URL is copied to the clipboard and should be shared with the client who wants to connect to the session.

Note: The port is optional for :LiveShareServer. For :LiveShareJoin, it's recommended not to change the port as serveo.net and localhost.run typically uses port 80 by default.

Preview

Live Share Preview

Basic settings

These settings are optional. You don't need to change them unless you want to customize the plugin's behavior.

require("live-share").setup({
  port_internal = 9876, -- The local port to be used for the live share connection
  max_attempts = 20, -- Maximum number of attempts to read the URL from service(serveo.net or localhost.run), every 250 ms
  service_url = "/tmp/service.url", -- Path to the file where the URL from serveo.net will be stored
  service = "nokey@localhost.run", -- Service to use, options are serveo.net or localhost.run
})

Lazy Example

{
  "azratul/live-share.nvim",
  dependencies = {
    "jbyuki/instant.nvim",
  },
  config = function()
    vim.g.instant_username = "your-username"
    require("live-share").setup({
      port_internal = 8765,
      max_attempts = 40, -- 10 seconds
      service = "serveo.net"
    })
  end
}

Contributing

Feel free to open issues or submit pull requests if you find any bugs or have feature requests.

Credits

instant.nvim - No longer maintained.

License

This project is licensed under the GPL-3.0 License.

live-share.nvim