leguinvim - neovim gui with non-monospace font support.
For people who want to use neovim for prose writing: SF novel, master thesis, letters...
May look awful with some plugins. Still very buggy. If you want to try it anyway, check how to install and configure it.
The name is a reference to SF writer Ursula K. Le Guin: neovim makes possible to edit text at the speed of thought, just as fast as Le Guin's characters with their telepathy abilities and their ansibles. The project could thus have been named gtkleguinvim (because it uses gtk). But it's too long.
leguinvim can render both monospace and non-monospace fonts in the same window. For example, you can use a non-monospace font for text and a monospace font for latex macros. (See configuration.)
# download linux binary (other platforms binaries will come soons!)
wget https://github.com/thjbdvlt/leguinvim/releases/latest/download/leguinvim
cp leguinvim ~/.local/bin/ # or wherever you want to install it
# or build (requires cargo)
git clone https://github.com/thjbdvlt/leguinvim leguinvim
cd leguinvim
make installTo configure leguinvim, use a ginit.vim file in your neovim configuration directory:
" e.g. ~/.config/nvim/ginit.vim
" main font
call rpcnotify(1, 'Gui', 'Font', 'Liberation Sans 12') " default
" monospace font used for floating windows
call rpcnotify(1, 'Gui', 'AltFont', 'Fira Code 12') " default
" use monospace font for floating windows. 0 or 1 (default)
call rpcnotify(1, 'Gui', 'FloatAltFont', 1)The rendering of non-monospace font by leguinvim is a quick and dirty (and ultra-lazy) solution, and kind of a hacky one: leguinvim doesn't try to wrap the lines by itself, it just lets neovim do it by character count.
Some lines can thus be very long, and some other very short??? Yes. But when writing prose, at least for some languages, and maybe surprisingly, it actually just works, because lines naturally tend to be a mix of narrow, wide and medium-width letters. Except for extreme edge-cases, like lines full of bold-uppercase W. For these cases, leguinvim reduce the font size for the line, to keep the whole text visible:
leguinvim is forked from neovim-gtk. (Lot of removals and changes.)
This project aims to stay simple. No funky widgets nor smooth scrolling. Just non-monospace fonts: that's still a lot to improves, lot of bugs to fix, of workarounds to find!


