Search for “how to modernize Vim” and nine out of ten guides open with “first migrate to Neovim + LazyVim.” Yet if you already have classic Vim 9 + vimplus + coc.nvim dialed in on Ubuntu—with all your muscle memory wired to comma (,) leader mappings—there is zero reason to throw everything away for a Lua rewrite.

By editing just 3 user-layer custom files (without ever touching ~/.vimplus/.vimrc), you can turn classic Vim 9 into a fast, modern dark frosted-glass terminal editor that blends seamlessly with the Ubuntu dark desktop and VS Code / Cursor setup built earlier in this series:

  • Unified dark frosted-glass visuals: 24-bit truecolor Catppuccin Mocha lets your frosted terminal background shine through the editor pane, while keeping Pmenu completion menus and coc.nvim hover windows opaque dark with sky-blue rounded borders for effortless legibility.
  • Modern UI ergonomics: pill-shaped vim-airline status and tab bars, minimal split dividers, hidden ~ end-of-buffer tildes, mode-aware terminal cursor shapes, and Vim 9 native leadmultispace indent guides replacing legacy indentLine.
  • Disciplined, verified performance: ~130ms cold startup, bounded syntax highlighting and sync depth on long lines, and true buffer-local >2MB large-file degradation that leaves zero side effects when you switch back to normal source files.

Here is the real result on my primary workstation (Ubuntu 22.04 LTS + dark frosted-glass Terminator + Vim 9.2 + Sarasa Term SC Nerd):

Classic Vim 9 + vimplus running transparent Catppuccin Mocha frosted glass, NERDTree icons, native Vim 9 vertical indent guides, and a pill-shaped Airline status bar


1. Test Baseline and Non-Invasive 3-File Boundary

This guide works both standalone and as the visual/performance capstone to Ubuntu vimplus Setup and Configuration Guide earlier in this series.

Dimension Tested Baseline
OS & Editor Ubuntu 22.04 LTS + Vim 9.2 + vimplus + coc.nvim (clangd)
Terminal & Font Terminator (frosted transparent background) + Sarasa Term SC Nerd
Color Palette Catppuccin Mocha (aligned with VS Code / Cursor)
Cold Startup ~131.8ms measured (with NERDTree / Airline / LeaderF / Tagbar / coc.nvim active)

To keep future upgrades and rollbacks painless, every single change is strictly scoped to 3 user-layer files, leaving ~/.vimplus/.vimrc completely untouched:

  1. ~/.vimrc.custom.plugins: adds just 1 line for the catppuccin/vim theme plugin.
  2. ~/.vimrc.custom.config: holds truecolor setup, layered transparency, pill status line, Vim 9 native indent guides, and performance/large-file hooks.
  3. ~/.vim/coc-settings.json: enables rounded borders for coc.nvim completion, hover documentation, and diagnostic floats.

2. Step 1: Install the catppuccin/vim Theme Plugin

Append one line to ~/.vimrc.custom.plugins for the official Vim theme plugin (which bundles both catppuccin_mocha and its matching vim-airline theme):

1
2
" ~/.vimrc.custom.plugins
Plug 'catppuccin/vim', { 'as': 'catppuccin' }

In Vim, press ,s to reload your config and run ,,i (or :PlugInstall). If GitHub occasionally times out from inside vim-plug, you can drop it straight into the plugin directory with a single shallow clone:

1
git clone --depth=1 https://github.com/catppuccin/vim.git ~/.vim/plugged/catppuccin

3. Step 2: Core Visuals & Performance Config (~/.vimrc.custom.config)

Below is the complete block you can append directly to the end of ~/.vimrc.custom.config (each non-obvious trade-off is explained inline and unpacked right after):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Modern terminal visuals & performance (Catppuccin Mocha + frosted glass + buffer-local large-file guard)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" 1. 24-bit truecolor (compatible with nested tmux / screen to prevent 256-color fallback)
if has('termguicolors')
if !empty($TMUX) || &term =~# '^screen\|^tmux'
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif
set termguicolors
endif

" 2. Layered transparency: transparent editor pane over frosted terminal, opaque dark popups & coc floats
function! s:ApplyTransparentCatppuccin() abort
for l:grp in ['Normal', 'NonText', 'LineNr', 'SignColumn', 'EndOfBuffer', 'Folded', 'FoldColumn', 'StatusLineNC', 'TabLineFill']
execute 'highlight ' . l:grp . ' ctermbg=NONE guibg=NONE'
endfor
highlight VertSplit ctermbg=NONE guibg=NONE guifg=#45475a
highlight CursorLine ctermbg=NONE guibg=#2a2b3d
highlight CursorLineNr ctermbg=NONE guibg=NONE guifg=#89b4fa gui=bold
highlight LineNr guifg=#6c7086
highlight SpecialKey guifg=#45475a
highlight Whitespace guifg=#3b3d52
" Keep completion & LSP floats opaque Catppuccin Base + sky-blue border so underlying code never bleeds through
highlight Pmenu guibg=#1e1e2e guifg=#cdd6f4
highlight PmenuSel guibg=#3584e4 guifg=#ffffff gui=bold
highlight PmenuSbar guibg=#313244
highlight PmenuThumb guibg=#585b70
highlight CocFloating guibg=#1e1e2e guifg=#cdd6f4
highlight CocMenuSel guibg=#3584e4 guifg=#ffffff gui=bold
highlight FloatBorder guibg=#1e1e2e guifg=#89b4fa
endfunction

" Register ColorScheme autocmd BEFORE calling colorscheme so transparency applies on initial load
augroup ModernVimBeautify
autocmd!
autocmd ColorScheme * call s:ApplyTransparentCatppuccin()
augroup END

" Safe switch to Catppuccin Mocha: gracefully fall back to onedark on fresh machines before PlugInstall
try
colorscheme catppuccin_mocha
let g:airline_theme = 'catppuccin_mocha'
catch /^Vim\%((\a\+)\)\=:E185/
colorscheme onedark
let g:airline_theme = 'onedark'
endtry

" 3. Minimal vertical split divider & hide end-of-buffer ~ tildes
set fillchars+=eob:\ ,vert:│

" 4. Pill-shaped Airline status line (requires a Nerd Font such as Sarasa Term SC Nerd)
" Pure ASCII Unicode escapes prevent copy-paste corruption and are byte-identical in Vim 9
let g:airline_left_sep = "\ue0b4"
let g:airline_left_alt_sep = "\ue0b5"
let g:airline_right_sep = "\ue0b6"
let g:airline_right_alt_sep = "\ue0b7"
let g:airline#extensions#tabline#left_sep = "\ue0b4"
let g:airline#extensions#tabline#left_alt_sep = "\ue0b5"

" Mode-aware terminal cursor shapes (Normal: block / Insert: bar / Replace: underline)
let &t_SI = "\e[6 q"
let &t_SR = "\e[4 q"
let &t_EI = "\e[2 q"

" 5. Editing ergonomics & Vim 9 native thin indent guides (zero-plugin replacement for indentLine)
set ttimeoutlen=10
set scrolloff=5
set sidescrolloff=5
set mouse=a
set number
set norelativenumber
set list
set listchars=tab:▸\ ,trail:·,leadmultispace:│\ \ \

" Uncomment below if you prefer hybrid relative line numbers (e.g., 6j / 8k)
" set relativenumber

" 6. Rendering limits & buffer-local >2MB large-file freeze protection
set synmaxcol=300
syntax sync maxlines=200
let g:NERDTreeExactMatchHighlightFullName = 0
let g:NERDTreePatternMatchHighlightFullName = 0

function! s:RestoreLargeFileEventIgnore() abort
if exists('s:large_file_saved_ei')
let &eventignore = s:large_file_saved_ei
unlet s:large_file_saved_ei
endif
endfunction

function! s:HandleLargeFilePre() abort
let l:file = expand('<afile>')
if empty(l:file)
return
endif
let l:size = getfsize(l:file)
if l:size > 2 * 1024 * 1024 || l:size == -2
let b:large_file = 1
let b:coc_enabled = 0
let b:current_syntax = 'largefile'
if !exists('s:large_file_saved_ei')
let s:large_file_saved_ei = &eventignore
endif
" Suppress FileType/Syntax only while reading the large file; restore immediately so other buffers stay clean
set eventignore+=FileType,Syntax
setlocal noswapfile undolevels=-1 bufhidden=unload
endif
endfunction

function! s:ApplyLargeFileLocal() abort
call s:RestoreLargeFileEventIgnore()
if get(b:, 'large_file', 0)
noautocmd setlocal filetype=largefile
setlocal syntax=OFF foldmethod=manual nowrap nolist nocursorline
let w:large_file_win_dirty = 1
elseif exists('w:large_file_win_dirty')
unlet w:large_file_win_dirty
setlocal foldmethod< wrap< list< cursorline<
endif
endfunction

augroup LargeFileOptimize
autocmd!
autocmd BufReadPre * call s:HandleLargeFilePre()
autocmd BufReadPost,BufWinEnter * call s:ApplyLargeFileLocal()
autocmd BufEnter * call s:RestoreLargeFileEventIgnore()
augroup END

There are 5 intentional anti-pitfall design choices packed into that snippet:

  1. Why register autocmd ColorScheme * before calling colorscheme?
    Putting bare highlight Normal guibg=NONE lines after colorscheme breaks the moment you reload your config or switch colorschemes. Registering the ColorScheme autocmd upfront and wrapping the switch in try/catch ensures transparency applies on first load while safely falling back to onedark on a fresh machine before :PlugInstall has run.
  2. Why layer “transparent main pane + opaque popups”?
    Making Pmenu and CocFloating transparent looks clever in screenshots until completion items and hover docs sit on top of colorful code and turn into unreadable visual soup. Pinning floats to opaque Catppuccin Base (#1e1e2e), a sky-blue border (#89b4fa), and a high-contrast selection bar (#3584e4) delivers frosted-glass ambiance without sacrificing IDE-grade legibility.
  3. Why use "\ue0b4"–"\ue0b7" escapes instead of literal glyphs for Airline pills?
    Powerline rounded separators live in the Unicode Private Use Area. Pasting raw glyphs into web pages frequently renders as □ boxes or silently corrupts when copied. In Vim 9, double-quoted escapes like "\ue0b4" are byte-for-byte identical to the literal characters and copy-paste cleanly every time.
  4. Why replace indentLine with Vim 9 native leadmultispace and set ttimeoutlen=10?
    • indentLine relies on conceal, which regularly hides quotes in JSON/Markdown and slows down scrolling in large files. Vim 9’s native listchars=...,leadmultispace:│\ \ \ is rendered directly in C with zero plugins, zero lag, and zero text distortion.
    • ttimeoutlen=10 eliminates the sluggish pause when pressing Esc to exit Insert mode while remaining safer than 0 (which can split arrow-key escape sequences over jittery SSH or tmux links).
  5. Why avoid syntax off or a naive BufReadPre filetype=largefile one-liner?
    • The most copy-pasted large-file snippet on the web runs autocmd BufReadPre * ... | setlocal eventignore+=FileType foldmethod=manual noswapfile | syntax off. That hides two global bugs: eventignore is a strictly global option (so setlocal permanently mutates &eventignore, breaking FileType detection for every subsequent small file in that Vim instance), and syntax off turns off syntax highlighting globally across the entire process.
    • On the other hand, if you drop eventignore and syntax off and merely set setlocal filetype=largefile in BufReadPre, Vim’s internal readfile() resets did_filetype upon entering BufRead, allowing filetypedetect to fire *.cpp -> setf cpp anyway—causing tagbar to run ctags synchronously over a multi-megabyte .cpp file and freeze the editor.
    • Because this 3-stage hook is registered in ~/.vimrc.custom.config, it runs after filetypedetect and before coc_nvim and TagbarAutoCmds: BufReadPre suppresses FileType,Syntax only during the read, BufReadPost/BufWinEnter (with a BufEnter safety net) immediately restores global &eventignore, applies noautocmd setlocal filetype=largefile + syntax=OFF so coc.nvim and tagbar skip in 0ms, and sets a window-dirty flag w:large_file_win_dirty = 1 that restores foldmethod, wrap, list, and cursorline via setlocal ...< as soon as you switch back to a normal file.

4. Step 3: Enable Opaque Rounded Floats in coc.nvim (~/.vim/coc-settings.json)

Pair the CocFloating and FloatBorder highlight groups above with rounded borders in ~/.vim/coc-settings.json for hover docs, completion popups, and diagnostic floats:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"suggest.noselect": true,
"coc.preferences.formatOnSave": false,
"hover.floatConfig": {
"border": true,
"rounded": true
},
"suggest.floatConfig": {
"border": true,
"rounded": true
},
"diagnostic.floatConfig": {
"border": true,
"rounded": true
}
}

Save and open a C++ file backed by compile_commands.json to verify both everyday popup flows:

  1. Press K for symbol hover documentation: the opaque #1e1e2e float with a thin #89b4fa rounded border sits cleanly above the frosted code pane—signatures, parameter types, and docstrings stay razor sharp with zero bleed-through:

Opaque rounded coc.nvim hover documentation float (#1e1e2e background with #89b4fa border) over frosted-glass Vim 9

  1. Enter Insert mode and type cache_. to trigger clangd completion: the bottom-left Airline pill flips smoothly to mint green INSERT, the cursor narrows to a vertical bar (\e[6 q), and the rounded dark completion popup opens cleanly:

Rounded dark coc.nvim completion popup and thin bar cursor in Insert mode


5. Step 4: Verify Startup Latency, Options, and Large-File Isolation

Don’t eyeball it—verify cold start time, active options, and large-file isolation with three concrete checks.

1. Cold Startup Benchmark

1
vim --startuptime /tmp/vim-startup.log +q && tail -n 15 /tmp/vim-startup.log

Measured tail on my machine (131.8ms total—effectively instantaneous in daily use):

1
2
3
4
5
6
7
8
078.115  002.935  002.935: sourcing ~/.vim/plugged/vim-fugitive/autoload/fugitive.vim
079.517 000.961 000.961: sourcing ~/.vim/plugged/tagbar/autoload/tagbar.vim
094.370 000.292 000.292: sourcing ~/.vim/plugged/tagbar/autoload/tagbar/types/uctags.vim
130.744 080.976: opening buffers
130.884 000.043 000.043: sourcing ~/.vim/plugged/LeaderF/autoload/lfMru.vim
131.598 000.811: BufEnter autocommands
131.600 000.002: editing files in windows
131.792 000.031 000.031: sourcing ~/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/buflist.vim

2. Active Theme & Core Option Check

Run inside Vim:

1
:echo g:colors_name &termguicolors &number &relativenumber

Expected output (theme name, 24-bit truecolor on, absolute line numbers on, relative line numbers off):

1
catppuccin_mocha 1 1 0

3. Dual-Machine >2MB Large-File Buffer Isolation Test

Tested on both Ubuntu 22.04 and Ubuntu 24.04 using generated 3MB+ .cpp files and normal small .cpp files across both :edit large.cpp -> :edit small.cpp and CLI launch vim large.cpp -> :edit small.cpp:

Test Environment Sample Files Large-File Buffer State Switching Back to Small .cpp in Same Window
Ubuntu 22.04 + Vim 9.2 + coc.nvim + tagbar 3.2MB (38,000 lines) .cpp → 88B .cpp 0.0337s (33.7ms instant open)
b:large_file=1, b:coc_enabled=0, ft=largefile, syn=OFF, synID= (empty), ul=-1, foldmethod=manual, list=0, cursorline=0
b:large_file=0, ft=cpp, syn=cpp; full syntax groups active (#include → cInclude, int → cType, strings → cppString); list=1, cursorline=1 auto-restored; &g:eventignore empty and g:syntax_on=1
Ubuntu 24.04 + Vim 9.1 + YouCompleteMe 3.3MB (100,000 lines) .cpp → small .cpp ft=largefile, syn=OFF, skips heavy parsers for instant open ft=cpp, syn=cpp, cInclude/cType highlights and list=1 fully restored with zero global leakage

6. Quick Toggles and One-Command Backup & Rollback

1. Three High-Frequency Toggles

Preference Edit in ~/.vimrc.custom.config
Solid dark background (no frosted transparency) Comment out the 4-line augroup ModernVimBeautify block to keep catppuccin_mocha‘s native #1e1e2e opaque base
Hybrid relative line numbers (6j / 8k) Uncomment " set relativenumber to pair with set number (absolute on current line, relative above/below)
Hide trailing-space dots (·) Remove trail:·, from listchars: set listchars=tab:▸\ ,leadmultispace:│\ \ \

2. One-Command Backup & Lossless Rollback

Snapshot all three user-layer files before editing; roll back cleanly at any time with a single copy command:

1
2
3
4
5
6
7
8
# One-command backup
mkdir -p ~/.local/share/vim-beautify-backup && \
cp -a ~/.vimrc.custom.plugins ~/.vimrc.custom.config ~/.vim/coc-settings.json ~/.local/share/vim-beautify-backup/

# One-command rollback (append `rm -rf ~/.vim/plugged/catppuccin` to remove the theme plugin too)
cp -a ~/.local/share/vim-beautify-backup/.vimrc.custom.plugins ~/.vimrc.custom.plugins && \
cp -a ~/.local/share/vim-beautify-backup/.vimrc.custom.config ~/.vimrc.custom.config && \
cp -a ~/.local/share/vim-beautify-backup/coc-settings.json ~/.vim/coc-settings.json

Classic Vim 9 + vimplus now matches your dark frosted-glass workstation in both aesthetics and speed. If you also want to bring your daily VS Code / Cursor polish, plugin-free tmux pill status bar (with truecolor and LSP undercurl passthrough), git-delta / fzf / fd / zoxide terminal workflow chain, and Typora / Guake / gedit into the exact same Catppuccin Mocha visual language, continue to the final installment 👉 End-to-End Ubuntu Dev Tools Visual & Workflow Unification: VS Code, Cursor, tmux, Git Delta, fzf, and Typora.


Series Navigation

# Article Core Topics
#0 Ubuntu Workstation Setup · Series Index End-to-end architecture blueprint, dual-machine baseline, and reading roadmap
#1 Ubuntu 22.04 GNOME Desktop Configuration Guide Fundamentals: GNOME extensions, window ergonomics, and X11 vs. Wayland
#2 Ubuntu GNOME Dark Frosted-Glass Desktop Framework and Dual File Manager Blur Opacity Fix (22.04 / 24.04) Fluent + Colloid + dynamic wallpaper, Blur my Shell tuning, and Nautilus/Nemo opacity fix
#3 Font Stack, Strict fontconfig Binding, fcitx5, and Shortcut Pitfalls Inter + HarmonyOS Sans SC + Sarasa, strong binding, and IME troubleshooting
#4 Terminal CLI, Qt5 Unification, VS Code/Cursor, and Chrome Alignment eza/bat/btop/fastfetch, qt5ct palette alignment, editors, and offline-safe Chrome script
#5 End-to-End Boot and Lockscreen Loop: GRUB, Plymouth, GDM, and Lockscreen GRUB baseline JPEG, Plymouth bgrt, non-destructive GDM, and global rollback matrix
#6 Ubuntu vimplus Setup and Configuration Guide Non-invasive vimplus modernization: coc.nvim + clangd, full LSP keymaps, and dual-mode Markdown preview
#7 No Neovim Required: Non-Invasively Turn Classic Vim 9 + vimplus into a Modern Dark Frosted-Glass Editor (Current post) Transparent Catppuccin Mocha, opaque rounded popups, pill status line, native Vim 9 indent guides, and buffer-local large-file optimization
#8 End-to-End Ubuntu Dev Tools Visual & Workflow Unification: VS Code, Cursor, tmux, Git Delta, fzf, and Typora VS Code/Cursor polish, plugin-free tmux pill status bar, delta/fzf/fd/zoxide chain, and Typora/Guake/gedit alignment