Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

VIM

My personal configuration for Vim (classic Vim).

Requirements

  • Vim 8.0+
  • git, curl — vim-plug and translation
  • python3 — 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. go for --all, node/npm for TypeScript)
  • Optional but recommended: astyle (autoformatting), ctags (tags/tagbar)
  • For clipboard support Vim needs the +clipboard feature — see Troubleshooting

Quick start

  1. Install Vim and clone the repository:

    git clone <repository-url>
    cd vimrc
    
  2. Run the setup script. It symlinks .vimrc to ~/.vimrc, writes your Doxygen author name and compiles YouCompleteMe:

    ./configure "Your Name"
    

Configure script

./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>.

Key mappings

<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)

Notes

  • The configuration is written for a Russian-speaking user: it enables Cyrillic encodings (koi8r, cp1251, cp866) and set 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 by autocmd VimEnter * PlugInstall --sync.
  • On X11/Linux the CapsLock key is remapped to Ctrl (setxkbmap -option 'ctrl:nocaps') on Vim start, if setxkbmap is available.

Troubleshooting

  • 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 default vim package on Arch) has an inert + register — install gvim (compiled with +clipboard).
  • Plugins are not installed. vim-plug auto-install happens on the first launch of a real (interactive) Vim. Run ./configure or :PlugInstall inside Vim.
  • <F3>/<F5> do nothing. vim-autoformat needs astyle, Tagbar/F5 need ctags — install them or check the AsyncRun output.

About

My own-written vim configuration.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages