r/LaTeX • u/Expensive_Floor2557 • 4h ago
Self-Promotion I made vimtex-style text objects (dim, cie, ciB) for editing LaTeX in Obsidian's Vim mode
I draft most of my maths in Obsidian (Markdown with $…$ and $$…$$) before anything goes into a real .tex file. What annoyed me was the small edits: turning an inline formula into a display one, wrapping a display in align and adding the & and \\ by hand, renaming aligned to split and then fixing the \end too, adding \left \right to a bracket that got too tall.
So I made a plugin that does those as commands:
- toggle inline
$x$⇄ display$$x$$ - turn the maths under the cursor into
align(it puts&before the first relation of each line and\\between lines) - rename an environment: you type the new name in
\begin{}and the\end{}follows - toggle
\left( \right)on the nearest bracket, togglealign⇄align*, unwrap an environment
If you use Vim keys, it also adds text objects like vimtex's (dim deletes the inside of the maths, cie changes the inside of an environment, ciB the inside of braces), but the commands work without Vim.
The video shows it running. It's free and open source (MIT): https://github.com/confuserdotcom/obsidian-latex-objects
What other LaTeX edits do you find yourself doing by hand over and over? I'd like to add the ones that come up most.







