Use Neovim in the browser.
Powered by Bunvim.
demo.mp4
Using lazy.nvim
{
"wallpants/ghost-text.nvim",
opts = {
-- config goes here
},
}
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,
})
Usually the steps to follow are:
- open Neovim (ghost-text.nvim automatically starts listenning for connections)
- on your browser select an input field and activate the extension
- 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 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
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.
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.
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
},
}