What is UTCS Vim?
A customized build of Vim for UT Austin Computer Science students and faculty. Based on Vim 9.2 with memory bug fixes, built-in LaTeX support, and the Longhorn (Burnt Orange) default theme.
Longhorn Theme
The default colorscheme uses the official UT Austin Burnt Orange (#BF5700) palette. Status line, tab bar, search highlights, and cursor all use Burnt Orange accents on a dark background.
LaTeX Support
Compile and view LaTeX documents without leaving Vim. :TexCompile, :TexView, quickfix error navigation, and multi-file project support — all built in.
Memory Fixes
Five memory bugs squashed: free() vs vim_free() mismatch, use-after-free in type copying, NULL deref in realloc profiling, duplicate cleanup call, and integer overflow protection.
Quick Start
# Clone
git clone https://github.com/abdonmorales/vim.git
cd vim/src
# Build
make -j$(nproc) # Linux
make -j$(sysctl -n hw.ncpu) # macOS
# Try it
./vim # Longhorn theme + Spring 2026 intro
./vim test.tex # LaTeX support (needs pdflatex)
# Install
sudo make install
What is Vim?
Vim is a greatly improved version of the good old UNIX editor Vi. Many new features have been added: multi-level undo, syntax highlighting, command line history, on-line help, spell checking, filename completion, block operations, script language, and more. There is also a Graphical User Interface (GUI) available.
Vim runs under MS-Windows (7, 8, 10, 11), macOS, Haiku, VMS, and almost all flavours of UNIX.
LaTeX Compile & View
The UTCS LaTeX plugin is automatically loaded when editing .tex files. It provides compilation, PDF viewing, auxiliary file cleanup, and quickfix error navigation.
Commands
| Command | Shortcut | Description |
|---|---|---|
:TexCompile | <Leader>ll | Compile with pdflatex. Errors are parsed into the quickfix list. |
:TexCompileFull | <Leader>lf | Full build: pdflatex → bibtex → pdflatex ×2. Needed for citations, cross-references, and TOC. |
:TexView | <Leader>lv | Open compiled PDF in system viewer (macOS: open, Linux: xdg-open, Windows: start). |
:TexClean | <Leader>lc | Remove auxiliary files: .aux, .log, .toc, .bbl, .blg, .synctex.gz, etc. |
Mappings
All mappings use <Leader>l as a prefix (default leader is backslash \). They use <Plug> so you can remap them:
nmap <buffer> <F5> <Plug>TexCompile
nmap <buffer> <F6> <Plug>TexView
Settings
Override these in your vimrc:
| Variable | Default | Description |
|---|---|---|
g:tex_compiler | "pdflatex" | LaTeX compiler command. Use "xelatex" or "lualatex" for Unicode. |
g:tex_compiler_flags | "-interaction=nonstopmode -file-line-error -synctex=1" | Flags passed to the compiler. |
g:tex_bibtex | "bibtex" | Bibliography processor. Set to "biber" for biblatex. |
g:tex_viewer | "open" / "xdg-open" | PDF viewer command. E.g., "zathura", "evince". |
g:tex_clean_extensions | (long list) | File extensions removed by :TexClean. |
Multi-File Projects
For projects with multiple .tex files, add a magic comment in the first 10 lines of each sub-file:
% !TEX root = main.tex
% !TEX root = ../thesis.tex
All compile and view commands will then operate on the root file.
Error Handling
When compilation fails, errors are loaded into the quickfix list. Navigate with:
| Command | Action |
|---|---|
:copen | Open the quickfix window |
:cnext | Jump to the next error |
:cprev | Jump to the previous error |
:cclose | Close the quickfix window |
Longhorn Theme
The default colorscheme for UTCS Vim, built on the official UT Austin brand palette. Burnt Orange is THE default — at every level: compiled-in GUI highlights, :colorscheme default, and the startup defaults.vim.
The original vanilla Vim colors are available as :colorscheme classic.
Color Palette
Compiled-in Highlight Groups
These GUI colors are baked into the binary — visible even with vim -u NONE:
| Group | Appearance |
|---|---|
| StatusLine | Burnt Orange bg, white bold text |
| StatusLineNC | Charcoal bg, limestone text |
| TabLineSel | Burnt Orange bg, white bold text |
| TabLine | Charcoal bg, limestone text |
| ModeMsg | Burnt Orange text (INSERT, VISUAL) |
| Title | Burnt Orange bold text |
| Search / IncSearch | Burnt Orange bg, white text |
| CursorLineNr | Burnt Orange bold text |
| Directory | Burnt Orange text |
| Pmenu | Charcoal bg, limestone text |
| PmenuSel | Burnt Orange bg, dark text |
| Cursor | Burnt Orange bg, dark text |
| Visual | Warm brown selection |
| DiffAdd | Green tint |
| DiffChange | Blue tint |
| DiffDelete | Red tint |
| MatchParen | Burnt Orange bold text |
| LineNr | Muted Burnt Orange |
Usage
" Longhorn is the default. To restore after switching:
:colorscheme longhorn
" or equivalently:
:colorscheme default
" To switch to vanilla Vim colors:
:colorscheme classic
" For best terminal colors, enable true color:
:set termguicolors
Customization
" Override after loading:
colorscheme longhorn
hi StatusLine guibg=#333F48
" Change accent color globally:
hi StatusLine guifg=#1a1e24 guibg=#5fafaf gui=bold
hi TabLineSel guifg=#1a1e24 guibg=#5fafaf gui=bold
Memory Bug Fixes
The Spring 2026 release includes five memory-related bug fixes and improvements to the core Vim C source code.
diff.c: free() vs vim_free()
Memory allocated by Vim's alloc()/lalloc() was freed with raw free(), bypassing Vim's memory profiling and safety checks. Both calls in run_linematch_algorithm() changed to vim_free().
File: src/diff.c:2420,2424
userfunc.c: Use-After-Free
copy_function() shallow-copied type pointers (uf_arg_types, uf_ret_type, uf_va_type, uf_func_type) that pointed into the original function's uf_type_list. When the original was freed, these became dangling pointers. Fixed by deep-copying all types via copy_type() into the copy's own type list.
File: src/userfunc.c:6198-6228
alloc.c: mem_realloc() NULL Crash
When called with ptr == NULL (which realloc() treats as malloc()), mem_pre_free() would dereference before the pointer, causing undefined behavior. Added a NULL guard. Affects MEM_PROFILE builds.
File: src/alloc.c:314
alloc.c: Duplicate ResetRedobuff()
free_all_mem() called ResetRedobuff() twice in a row — a copy-paste bug. Removed the duplicate call.
File: src/alloc.c:512-513
alloc.c: Integer Overflow in ga_grow_inner()
The computation itemsize × (ga_len + n) could silently wrap around for very large growing arrays, allocating a too-small buffer and causing heap corruption. Added an overflow check that returns FAIL on wrap-around.
File: src/alloc.c:747
Installation
Build from Source
# Clone the repository
git clone https://github.com/abdonmorales/vim.git
cd vim/src
# Configure (optional — defaults are fine for most users)
./configure --with-features=huge --enable-multibyte
# Build
make -j$(nproc) # Linux
make -j$(sysctl -n hw.ncpu) # macOS
# Install system-wide
sudo make install
Verify
# Check version
vim --version | head -1
# Expected: VIM - Vi IMproved 9.2 (2026 Feb 14, compiled ...)
# See the intro screen
vim
# Expected: "UTCS VIM - Vi Improved 9.2" and "Spring 2026 Release"
# Check help
vim -c ":help tex-utcs"
vim -c ":help longhorn"
Platform-Specific Notes
| Platform | Readme |
|---|---|
| Unix / Linux | READMEdir/README_unix.txt |
| macOS | READMEdir/README_mac.txt |
| MS-Windows | READMEdir/README_dos.txt |
| Haiku | READMEdir/README_haiku.txt |
| VMS | READMEdir/README_vms.txt |
LaTeX Prerequisites
To use the LaTeX compile commands, you need a TeX distribution installed:
| Platform | Install Command |
|---|---|
| macOS | brew install --cask mactex |
| Ubuntu / Debian | sudo apt install texlive-full |
| Fedora | sudo dnf install texlive-scheme-full |
| Arch | sudo pacman -S texlive-most |
| Windows | MiKTeX or TeX Live |
License
Vim is Charityware. You can use and copy it as much as you like, but you are encouraged to make a donation to help orphans in Uganda. See :help uganda inside Vim for details.
The license is GPL compatible. There are no restrictions on using or distributing an unmodified copy of Vim. For modified versions, a few restrictions apply. See runtime/doc/uganda.txt.