My personal configuration for Vim (classic Vim).
- Vim 8.0+
git,curl— vim-plug and translationpython3— required by vim-translator and YouCompleteMe- A C++ build toolchain (
cmake,gcc/clang) to compile YouCompleteMe - YouCompleteMe may need extra build dependencies depending on the selected completers (e.g.
gofor--all,node/npmfor TypeScript) - Optional but recommended:
astyle(autoformatting),ctags(tags/tagbar) - For clipboard support Vim needs the
+clipboardfeature — see Troubleshooting
-
Install Vim and clone the repository:
git clone <repository-url> cd vimrc -
Run the setup script. It symlinks
.vimrcto~/.vimrc, writes your Doxygen author name and compiles YouCompleteMe:./configure "Your Name"
./configure "John Doe" # symlink .vimrc to ~/.vimrc, set author name, install plugins if needed, compile YouCompleteMe
./configure --no-ycm # same, but skip plugin install and YouCompleteMe compilation
./configure --update # update all plugins (PlugUpdate) and recompile YouCompleteMe
./configure --clean # remove ~/.vim/author.vim (falls back to "Your Name")
./configure --unlink # remove the ~/.vimrc symlink to this repository
./configure # prompt for the name (or set $VIM_AUTHOR)
YouCompleteMe compilation falls back automatically: ./install.py --all, then ./install.py --clangd-completer, then plain ./install.py. ~/.vimrc becomes a symlink to the repository's .vimrc, an existing ~/.vimrc is never overwritten. The name is stored in ~/.vim/author.vim and is used for Doxygen comments via <F9>.
<leader> is Space.
| Key | Action |
|---|---|
jj |
Exit insert mode (like Esc) |
<F1> |
Clear search highlighting |
<F2> |
Toggle Tagbar |
<F3> |
Autoformat (needs astyle) |
<F4> |
Toggle spell checking |
<F5> |
Rebuild ctags (needs ctags) |
<F9> |
Insert Doxygen comment |
<leader>t |
Translate word/selection (vim-translator) |
<C-n> |
Toggle NERDTree |
<C-h/j/k/l> |
Jump to the window on the left/down/up/right |
<C-Arrows> |
Create a split and jump into it |
<C-S-c> |
Copy selection to the system clipboard |
<C-S-v> |
Paste from the system clipboard |
| Arrows | Disabled in normal mode (use h/j/k/l) |
- The configuration is written for a Russian-speaking user: it enables Cyrillic encodings (
koi8r, cp1251, cp866) andset spelllang=en,ru. - Plugins are managed by vim-plug and stored in
~/.vim/plugged. vim-plug is bootstrapped automatically on the first Vim launch, and plugins are installed byautocmd VimEnter * PlugInstall --sync. - On X11/Linux the CapsLock key is remapped to Ctrl (
setxkbmap -option 'ctrl:nocaps') on Vim start, ifsetxkbmapis available.
- Clipboard (
<C-S-c>/<C-S-v>) does not copy/paste. The mappings rely on the+register. In terminals like GNOME Terminal or Ghostty,<C-S-c>/<C-S-v>are handled by the terminal itself (it copies its own selection), which usually still works. But if nothing is copied at all, check whether Vim was built with the clipboard feature:vim --version | grep clipboard. A build with-clipboard(e.g. the defaultvimpackage on Arch) has an inert+register — installgvim(compiled with+clipboard). - Plugins are not installed. vim-plug auto-install happens on the first launch of a real (interactive) Vim. Run
./configureor:PlugInstallinside Vim. <F3>/<F5>do nothing.vim-autoformatneedsastyle, Tagbar/F5 needctags— install them or check the AsyncRun output.