by mixedmath · 2y ago · 0 comments
It's interesting that this post (or rather, the later post that discusses this) talks about the advantages of UltiSnips. The well-known vim-LaTeX posts written by Gilles Castel (RIP) relied pivotally on UltiSnips.
It's not just that UltiSnips is a snippet engine. There are many of those (including LuaSnip, the other snippet engine mentioned in the OP series of articles). It's that UltiSnips can dispatch arbitrary expressions to short python code sections, and python has a great scientific library. For example, it's trivial to write a `sympy` snippet that will simplify or compute a given expression and write the output in latex for you.
But UltiSnips works *terribly* with neovim [1] [2]. Why? Because UltiSnips uses python, and neovim's python interface is 100x slower than vim's python interface. There are design decisions for this and I'm not trying to say that neovim is bad. I use both vim and neovim. But I use vim+UltiSnips+vimtex for writing LaTeX.
LuaSnip has interpolation too. I suppose it would be possible to write more code that calls from LuaSnip to a system like sympy (or other). But that's work. On the other hand, I think it takes a true power user to actually want or use the fancy interpolation functions.
[1]: https://github.com/SirVer/ultisnips/issues/974 [2]: https://github.com/SirVer/ultisnips/issues/1533
I'm using neovim with UltiSnips (and VimTeX), and I don't really have any big issues with it. I'm not saying you are wrongm but I do think the problem may be somewhat exagerated.
But somehow this suggests to me that I might have been doing something wrong. I use vim+ultisnips+(your excellent vimtex) while you use neovim. Out of curiousity, do you specifically set your python provider for your neovim in your config?
Yes, I do. I use a dedicated virtual environment for neovim which I create with the following snippet; then I set the `g:python3_host_prog` accordingly [0].
mkdir -p ~/.local/venvs/nvim
python -m venv ~/.local/venvs/nvim
source ~/.local/venvs/nvim/bin/activate
pip install --upgrade pip
pip install pynvim
[0]: https://github.com/lervag/dotnvim/blob/c3169dd18f4396258f83c...I didn't start the editor wars, but the neovim team jumped in with both feet. They deserve the ire of those of us who never wanted to see vim forked in the first place, let alone a half-assed broken "neo" version.