You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure you have a vim/neovim instance open. Run :GhostStart to start the server.
On any textarea, click the ghost icon - switch to neovim and edit!. Content is sync’ed real time. Works both ways - edits in the browser window are pushed to neovim as well.
When done, just delete the buffer with :bd! - you’ll be disconnected
Configuring filetype
Whenever a buffer is connected, a User event vim-ghost#connected is raised. Here’s a quick sample of
setting filetype to markdown if the textarea was on github or reddit
function! s:SetupGhostBuffer()
if match(expand("%:a"), '\v/ghost-(github|reddit)\.com-')
set ft=markdown
endif
endfunction
augroup vim-ghost
au!
au User vim-ghost#connected call s:SetupGhostBuffer()
augroup END
Requirements
Recent neovim/vim
Python 3.4+
Python plugin host - python3 -c 'import pynvim' should not error
# Ensure that you install this module for the version of python# that is loaded in neovim
pip install pywinauto
Limitations: Currently, on windows, the processname is hardcoded to nvim-qt
If you use any of the other GUIs for neovim (OniVim, gonvim etc) then this
will not work.
Rationale
With Firefox moving to webextensions, It’s all text is dead. Typing in text areas is a royal PITA and I was looking for a replacement. Came across GhostText - but the vim addon seems dead and uses tcl :ugh:
My vimscript fu is pretty limited - so I thought I’d write a python plugin for neovim.
TODOS
PR’s welcome. Some areas:
vim compatibility - DONE
Love it or just find it as useful as I do? Star this repo to let me know
About
Vim/Nvim client for GhostText - Edit browser text areas in Vim/Neovim