Git Product home page Git Product logo

ghost-text.nvim's Introduction

Neovim GhostText

Use Neovim in the browser.

Powered by Bunvim.

demo.mp4

โœ… Requirements

  1. GhostText browser extension
  2. Bun
  3. Neovim

๐Ÿ“ฆ Installation

Using lazy.nvim

{
    "wallpants/ghost-text.nvim",
    opts = {
        -- config goes here
    },
}

โš™๏ธ Configuration

All values are optional, you can leave empty to use default values. Any values you specify will be deeply merged with this dictionary.

require("ghost-text").setup({
    -- port used by local server
    port = 4001,

    -- automatically start server
    -- if "false", you must manually call ":GhostTextStart" to start server
    autostart = true,

    -- map url patterns to filetypes to set the buffer to
    -- matching done by https://github.com/isaacs/minimatch
    filetype_domains = {
      -- markdown = { "*.openai.com*", "*.github.com*" },
    },

    -- for debugging
    -- nil | "debug" | "verbose"
    log_level = nil,
})

๐Ÿ’ป Usage

Usually the steps to follow are:

  1. open Neovim (ghost-text.nvim automatically starts listenning for connections)
  2. on your browser select an input field and activate the extension
  3. a synced buffer is created in Neovim
    • The buffer is created in the Neovim instance where ghost-text.nvim was most recently started. If you want a specific Neovim instance to handle this, call :GhostTextStart in that Neovim instance before activating the extension in your browser.

The synced buffer will sync changes bidirectionally. Any changes in the browser input will update Neovim's buffer. Any changes to the buffer will update the browser input.

:GhostTextStart

Start listenning for connections. Any previously created ghost-text.nvim instances are killed.

You should only call :GhostTextStart if you're lazy-loading the plugin or if you want a specific Neovim instance to handle the connection.

๐Ÿ’ค lazy-loading

I recommend you don't lazy-load this plugin as having it autostart is a better experience. That being said, you can configure lazy.nvim to lazyload ghost-text.nvim with the following setup.

{
    "wallpants/ghost-text.nvim",
    cmd = { "GhostTextStart" },
    opts = {
        autostart = false
        -- ...your config
    },
}

ghost-text.nvim's People

Contributors

wallpants avatar

Stargazers

Islam Sharabash avatar Satsuki Akiba avatar Omar Magdy avatar  avatar

Watchers

 avatar

ghost-text.nvim's Issues

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.