iTranslated by AI
I created 'wenvi' to edit browser text areas with Vim
Have you ever wanted to use vi commands in your browser's text editing areas?
You can technically do it with copy-and-paste, but frankly, it is quite cumbersome.
I created Wenvi specifically to handle this copy-and-paste process completely.
It is a tool that temporarily takes input fields from the browser into Neovim for editing and automatically writes the results back.
When combined with the Vimium browser extension, you can navigate your browser comfortably without needing to reach for your mouse.
Also, have you ever accidentally sent a message in the browser version of ChatGPT by pressing Enter when you intended to trigger a Japanese IME conversion? I do it all the time. Since Wenvi uses Neovim for editing, you will never accidentally send a message prematurely.
There are other products that offer similar functionality:
- Wasavi: This was my favorite and I used it for a long time. However, it stopped working at some point. This was the catalyst for me to develop Wenvi.
- Firenvim: In my environment, it did not play well with Japanese input and I couldn't use it.
- GhostText: A very cool product that synchronizes in real-time in both directions. However, I was dissatisfied with the fact that it requires mouse operations to switch between the editor and the browser, as I want to complete my work using only the keyboard. Another drawback is that it cannot be used in contenteditable editing areas like ChatGPT.
- Wenvi: I have been using it daily for over a month now and have improved the parts that were difficult to use. Now, I am using it very comfortably.
If you are interested, please take a look.
I am not entirely confident about the installation instructions. I would appreciate it if you could let me know if you encounter any problems. Please feel free to ask questions.
I have included the GitHub README below (mostly machine-translated).
wenvi
Edit content editable in your browser using Neovim.
Copy-and-paste is fully automated.
wenvi extracts the content of an editable element (textarea, input, or contenteditable) temporarily, opens it in Neovim, and writes the result back when editing is finished.
- No browser extension required.
- No manual copy-and-paste required.
- Use Neovim exclusively outside the browser.
Features
- Edit editable elements (textarea, input, or contenteditable) in your browser with Neovim.
- Automatically synchronizes the edited content back to the browser upon completion.
- Saves editing buffers in
dataHome(default:~/.cache/wenvi), allowing you to use grep, diff, etc. - Organizes files by domain and includes the page title in the filename.
Requirements
- macOS, Neovim, Hammerspoon, Chromium-based browser, Python (toml module)
Installation
git clone https://github.com/kibi2/wenvi.git ~/wenvi
cd ~/wenvi
cp examples/hammerspoon/wenvi_config.lua.example ~/.hammerspoon/wenvi_config.lua
mkdir -p ~/.config/wenvi/
cp examples/config.toml.example ~/.config/wenvi/config.toml
Please edit the paths in
wenvi_config.luato suit your environment.
Also, adjust the contents ofconfig.tomlas needed.
Example of Neovim init:
vim.opt.runtimepath:append('/path/to/wenvi_home/editor/nvim')
require 'wenvi'
Please edit
/path/to/wenvi_home/to suit your environment.
Usage
- Open a browser page and press ⌘E (the shortcut is customizable).
- ~/wenvi/platforms/macos/hammerspoon/wenvi/init.lua
- Neovim will start and automatically load the text.
- Edit the text in Neovim. When you close the buffer, the changes will be automatically written back.
License
MIT License. See the LICENSE file.
Discussion