Ubuntu vimplus Setup and Configuration Guide
hippo: Want a smooth C/C++ and Markdown workflow in Vim on Ubuntu without building a plugin stack from scratch? I use
vimplusas the base, swap out the completion engine for a compile-free, fastercoc.nvim + clangdstack, isolate every change inside user custom files, and wire up dual-mode Markdown preview (browser + terminal). This guide documents the complete, reproducible setup.
1. Architecture and Non-Invasive Principles
vimplus is a classic one-click Vim C/C++ configuration framework. Out of the box, it bundles NERDTree (file explorer), LeaderF (fuzzy finder), Tagbar (symbol outline), vim-airline (status line), and a cohesive set of comma (,) leader keybindings.
Running the stock setup on modern Ubuntu (22.04 / 24.04), however, hits two unavoidable pain points:
- Its default completion engine is YouCompleteMe (YCM), which pulls heavy C++ dependencies and compiles locally—slow and prone to Python/Clang version mismatches.
- It lacks live Markdown preview as well as modern LSP (Language Server Protocol) ergonomics like hover docs, symbol rename, and one-key Quickfix.
This guide follows a “framework base + non-invasive user-layer override” pattern:
- Keep
~/.vimplus/.vimrcas the untouched skeleton—never edit it directly; - Put plugin additions/removals in
~/.vimrc.custom.plugins, keymaps and behavior in~/.vimrc.custom.config, and LSP options in~/.vim/coc-settings.json; - Replace YCM with
coc.nvim+clangdand addmarkdown-preview.nvim+glow, avoiding local C++ build pitfalls while leaving a clean foundation for visual theming and performance tuning later.
2. Install System and Runtime Dependencies
Install the build toolchain, symbol indexer, Node.js (runtime for coc.nvim), clangd, and the terminal Markdown renderer glow in one pass:
1 | # 1. Core system dependencies |
What each core dependency provides:
| Component | Purpose |
|---|---|
vim |
Vim 9.x (stock or upgraded on Ubuntu 22.04/24.04; check via vim --version | head -n 1) |
universal-ctags / ack-grep |
Backends for Tagbar symbol outlines and LeaderF project-wide search |
nodejs + yarn |
Runs the async coc.nvim LSP host and builds markdown-preview.nvim |
clangd |
C/C++ language server providing completion, go-to-definition, references, and live diagnostics |
glow |
Lightweight terminal Markdown renderer for reading docs in a standalone window or Vim’s built-in terminal split |
Verify the installed versions:
1 | vim --version | head -n 1 |
3. Install vimplus and the Custom Plugin Layer
3.1 Clone and Initialize vimplus
1 | git clone https://github.com/chxuan/vimplus.git ~/.vimplus |
The installer symlinks ~/.vimrc -> ~/.vimplus/.vimrc and creates two user customization entry points in your home directory:
~/.vimrc.custom.plugins: manages extra plugins to install or bundled plugins to disable;~/.vimrc.custom.config: overrides base options, keymaps, and theme settings.
3.2 Declare coc.nvim and Markdown Preview in ~/.vimrc.custom.plugins
Open ~/.vimrc.custom.plugins to disable stock YCM and add coc.nvim plus markdown-preview.nvim:
1 | " ~/.vimrc.custom.plugins |
3.3 Batch-Install Plugins
1 | vim -c "PlugInstall" -c "q" -c "q" |
Tip: If
markdown-preview.nvimthrows ayarn installerror during:PlugInstall, you do not need to reinstall everything—just run the build step manually inside its plugin directory:
1 cd ~/.vim/plugged/markdown-preview.nvim && yarn install && cd app && yarn install
4. Configure coc.nvim UX and Dual-Mode Markdown Preview
4.1 Wire Up LSP and Preview Shortcuts in ~/.vimrc.custom.config
Many users install coc.nvim and immediately run into “pressing Enter doesn’t confirm completion” or “gd intermittently fails”. Both issues come from missing interactive mappings and vimplus‘s default bindings overriding gd/gr. Add the following block to ~/.vimrc.custom.config to set everything up cleanly:
1 | " ~/.vimrc.custom.config |
4.2 Initialize ~/.vim/coc-settings.json and coc-clangd
Create a baseline coc.nvim config (avoid auto-selecting the first completion candidate, and disable format-on-save so you do not introduce unrelated formatting diffs in shared repos):
1 | mkdir -p ~/.vim |
Next, install the coc-clangd extension synchronously:
1 | vim -c "CocInstall -sync coc-clangd" -c "q" -c "q" |
Key tip for accurate C/C++ completion:
clangdrelies on acompile_commands.jsonfile at the project root to resolve include paths and preprocessor macros accurately.
- CMake projects: Pass
-DCMAKE_EXPORT_COMPILE_COMMANDS=ONduring configure, then symlinkbuild/compile_commands.jsonto the project root.- Makefile projects: Install
bear(sudo apt install bear) and runbear -- makeonce to generate it automatically.
5. Configure a Nerd Font
NERDTree and vim-airline rely on Nerd Font icon glyphs.
- Recommended (aligned with this series’ desktop typography): Use
Sarasa Term SC Nerdconfigured in Part 3—it enforces strict 2:1 CJK/Latin monospace alignment while natively covering Powerline, pill, and filetype glyphs. - Lightweight fallback for English-only code: If you have not installed Sarasa yet, use the font bundled with
vimplus:
1 | mkdir -p ~/.local/share/fonts |
Select the Nerd Font in Terminator / GNOME Terminal preferences, then fully close and reopen the terminal so the icons render properly (terminals load fonts at startup and do not always refresh existing windows mid-session).
6. Verification Checklist and Additional Languages
Open a C/C++ file in a project with compile_commands.json alongside a .md document and verify each feature:
| Feature | Shortcut / Command | Expected Result |
|---|---|---|
| File tree | ,n |
Toggles NERDTree on the left with properly rendered icons (no missing boxes) |
| Fuzzy file finder | ,f |
Opens the LeaderF fuzzy search popup |
| Code completion | Type . / -> or identifier |
coc.nvim opens clangd suggestions; Tab cycles, Enter confirms |
| Hover docs | K |
Displays function/type signature and comments under the cursor |
| Definition & references | gd / gr |
Jumps accurately to the definition or lists all references |
| Rename & quickfix | ,rn / ,qf |
Safely renames symbols across files / opens diagnostic quickfixes |
| Symbol outline | ,t |
Toggles Tagbar function/struct outline on the right |
| Browser Markdown preview | <F7> / <F8> |
Starts and stops live browser-synced Markdown preview |
| Terminal Markdown preview | ,mp / ,mv |
Renders via glow in a standalone Terminator window or Vim 9 :terminal split |
| LSP health check | :CocInfo |
Shows clangd service status as running |
To add Python, JSON, Shell, or frontend language support, install the matching coc extensions:
| Extension | Language | Install Command |
|---|---|---|
coc-pyright |
Python | :CocInstall coc-pyright |
coc-json |
JSON / JSONC | :CocInstall coc-json |
coc-sh |
Bash / Zsh | :CocInstall coc-sh |
coc-html / coc-css |
HTML / CSS | :CocInstall coc-html coc-css |
7. Backup and Cross-Machine Migration
All customizations live in just 3 user files plus ~/.vimplus, making backup and migration straightforward:
1 | # Back up |
With that, you have a compile-free Vim 9 terminal IDE with full LSP support and dual-mode Markdown preview up and running.
Next step (modern visuals & performance tuning): A freshly configured
vimplusis already productive, but visually and performance-wise it still feels like a previous-generation terminal setup—its opaque background clashes with a dark frosted-glass desktop, completion popups lack rounded borders, and large files can freeze the editor. In the next part, we stick to the exact same non-invasive 3-file rule to upgrade classic Vim 9 +vimpluswith transparent Catppuccin Mocha frosted glass + pill status line + native Vim 9 indent guides + ~130ms cold start + >2MB buffer-local large-file freeze protection 👉 No Neovim Required: Non-Invasively Turn Classic Vim 9 + vimplus into a Modern Dark Frosted-Glass Editor.
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 (Current post) | 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 | 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 | Fine-tuned VS Code/Cursor, plugin-free tmux pill status bar, delta/fzf/fd/zoxide chain, and Typora/Guake/gedit polish |








