Giter Club home page Giter Club logo

live-server.nvim's Introduction

live-server.nvim

Use live-server from NPM inside Neovim seamlessly!

Installation

use({
  "aurum77/live-server.nvim",
    run = function()
      require"live_server.util".install()
    end,
    cmd = { "LiveServer", "LiveServerStart", "LiveServerStop" },
  })

Usage

Runs when you call :LiveServer

Configuration

Default:

local status_ok, live_server = pcall(require, "live_server")
if not status_ok then
  return
end

live_server.setup({
  port = 8080,
  browser_command = "", -- Empty string starts up with default browser
  quiet = false,
  no_css_inject = false, -- Disables css injection if true, might be useful when testing out tailwindcss
  install_path = vim.fn.stdpath "config" .. "/live-server/",
})

Example:

local status_ok, live_server = pcall(require, "live_server")
if not status_ok then
  return
end

live_server.setup({
  port = 7567,
  browser_command = "firefox", -- Command or executable path
  quiet = false,
  no_css_inject = true,
  install_path = os.getenv("HOME") .. "/live/",
})

Requirements

  • npm

What ?

This plugin installs live-server to

:lua print(vim.fn.stdpath("data") .. "/live-server/")

When ? How long did it take you to write this ?

The initial implementation took about a day since I am quite new to Lua and Neovim programming / API

Why ?

I was bored of Javascript and wanted to learn about creating plugins for Neovim using Lua, also I wasn't able to find plugins that would work similarly to this one!

Goal(s)

  • 1-1 feature parity with VSCode's Live Server extension

Also

I like cats ๐Ÿฑ Feel free to open a pull request or give recommendations to au#4829 on Discord

Thanks

Neovim Lua Plugin From Scratch

How to Write a Neovim Plugin with Lua

Neovim documentation

live-server.nvim's People

Contributors

aurum77 avatar dharmx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.