4 ms·
I always like people's LaTeX-based note taking setups. I'm a mathematician, so I write a lot of LaTeX too. (And I use vim, so I really like vim+Latex workflows)
by mixedmath 3y ago
I always like people's LaTeX-based note taking setups. I'm a mathematician, so I write a lot of LaTeX too. (And I use vim, so I really like vim+Latex workflows).
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 https://github.com/SirVer/ultisnips/issues/974
[2]: https://github.com/SirVer/ultisnips/issues/1533 https://github.com/SirVer/ultisnips/issues/1533
- vonwoodson 3y agoI'll go ahead and say that neovim is bad. Any reason to use neovim has long since past. 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.
- lervag 3y ago> 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. 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.
- mixedmath 3y agoThat's interesting. My problem is very similar to the issue I labelled [2] above --- where there would be more than a second of delay in interacting with some snippets. 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?
- lervag 3y ago> 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/c3169dd18f4396258f83cedacde5e64c4a9250a8/lua/lervag/init/options.lua#L146 https://github.com/lervag/dotnvim/blob/c3169dd18f4396258f83c...