-
-
Save anisyanka/af16e6fb0515d2fe95c531f588f719c8 to your computer and use it in GitHub Desktop.
Minimal .vimrc for C/C++ developers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" VIM Configuration File | |
" Description: Optimized for C/C++ development. | |
" set UTF-8 encoding | |
set enc=utf-8 | |
set fenc=utf-8 | |
set termencoding=utf-8 | |
" disable vi compatibility (emulation of old bugs) | |
set nocompatible | |
" use indentation of previous line | |
set autoindent | |
" use intelligent indentation for C | |
set smartindent | |
" configure tabwidth and insert spaces instead of tabs | |
set tabstop=8 " tab width is 8 spaces | |
set shiftwidth=8 " indent also with 8 spaces | |
" wrap lines at 120 chars. 80 is somewaht antiquated with nowadays displays. | |
set textwidth=120 | |
" turn syntax highlighting on | |
syntax on | |
" turn line numbers on | |
set number | |
" highlight matching braces | |
set showmatch | |
" intelligent comments | |
set comments=sl:/*,mb:\ *,elx:\ */ | |
" Install OmniCppComplete like described on http://vim.wikia.com/wiki/C++_code_completion | |
" This offers intelligent C++ completion when typing ‘.’ ‘->’ or <C-o> | |
" Load standard tag files | |
set tags+=~/.vim/tags/syslib-tags | |
" keyboard enhancement | |
set backspace=indent,eol,start | |
nmap <F3> :NERDTreeToggle<CR> | |
imap <F3> <ESC>:NERDTreeToggle<CR> | |
" You Complete Me | |
nmap <F12> :YcmCompleter GoTo<CR> | |
imap <F12> <ESC>:YcmCompleter GoTo<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment