Edit browser textarea content in Neovim!

  1. Install this firefox addon or this Chrome extension

  2. Add this plugin

    " Vim-plug
    Plug 'raghur/vim-ghost', {'do': ':GhostInstall'}Copy the code
  3. Ensure you have a neovim instance open. Run :GhostStart to start the server.

  4. On any textara, 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.

  5. When done, just delete the buffer with :bd! – you ‘ll be disconnected

Requirements

  • Recent neovim

  • Python 3.4 +

  • Python plugin host – python3 -c 'import neovim' should not error

  • Python websocket server github.com/dpallot/sim…

    • This is automatically installed as a pip --user dependency when :GhostInstall runs.

Optional, but highly recommended – Switching focus to Neovim

  • Linux: The xdotool command – if available, will be used to focus the nvim window. Works in console, tmux or guis like neovim-qt

    • On Ubuntu, you can install it with sudo apt-get install xdotool

  • Windows: If pywinauto (github.com/pywinauto/p…). is available, it will be used to bring the neovim-qt to foreground.

    # Ensure that you install this module for the version of python
    # that is loaded in neovim
    pip install pywinautoCopy the code

    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.

PS: I know the repo name of vim-ghost is misleading.

TODOS

PR ‘s welcome. Some areas:

  • vim compatibility

  • py2 support

Love it or just find it as useful as I do? Star this repo to let me know