In this article, I compare these two approaches to editing LaTeX documents on Overleaf:
- Edit directly using Overleaf's editor.
- My setup: fetch from Overleaf using git, edit locally (using vim, pdflatex, and macOS Preview), and push to Overleaf using git.
Table of Contents
Details of My Setup¶
I edit latex code in vim and sync it to Overleaf using Git.
Advantages of Local Editing over Overleaf¶
- Offline use: Very useful in flights or areas with spotty connectivity. Danger of losing changes with Overleaf?
- Git: For checking diffs, branching, selectively committing/discarding changes.
- Fully customizable editor.
- With local PDF viewer, I can go back after clicking a hyperref.
- Overleaf's custom PDF viewer doesn't have bookmarks sidebar. I can use browser's PDF viewer instead of Overleaf's custom viewer to get back bookmarks, but then I lose dark mode and synctex.
- Spellcheck: Vim can iterate over typos. Vim can have per-project spellfile. Overleaf can't do these.
Advantages of Overleaf over Local Editing¶
- Simultaneous editing
- SyncTex: can jump from position in PDF to position in code and vice versa.
Features available in Both Setups¶
- Smart Autocomplete: Using the TexLab plugin in Vim.
- Dark mode PDFs:
As of Feb 2026, Overleaf does this using the CSS filter
invert(95%) hue-rotate(180deg) brightness(90%) contrast(90%);. When building PDFs locally, I use github:sharmaeklavya2/tex-colorscheme. Overleaf's solution is much cleaner here.