" This option stops Vim from behaving in a strongly Vi -compatible way. set nocompatible " Allow backspacing over audoindent, line breaks and the start of insert. set backspace=indent,eol,start " Copy indent from current line when starting a new line. set autoindent " Show the line and column number of the cursor position. set ruler " Show command in the last line of the screen. set showcmd " Search options: " - hlsearch: When there is a previous search pattern, highlight all its matches. " - ignorecase: Ignore case in search patterns. " - incsearch: While typing a search command, show where the pattern, as it was typed so far, matches. set hlsearch ignorecase incsearch " When a bracket is inserted, briefly jump to the matching one. set showmatch " When set to "dark", Vim wil try to use colors that look good on a dark background. set background=dark " When wrap is set to off lines will not wrap. set nowrap " Print the line number in front of each line. set number " Use the appropriate number of spaces to insert a . set expandtab " Number of spaces that a in the file counts for. set tabstop=4 " Number of spaces to use for each step of (auto)indent. set shiftwidth=4 " Do smart autoindenting when starting a new line. set smartindent " Make command :set makeprg=make\ %<\ LDLIBS=\"-lm\"\ CFLAGS=\"-Wall\ -O2\ -static\"\ CPPFLAGS=\"-Wall\ -O2\ -static\" " Mappings map :w map :tabnew:e map :q! map :tabprev map :tabnext map :w:make map :!time ./%< map :w:make:!time ./%< imap :wa imap :tabnew:e imap :q! imap :tabprevi imap :tabnexti imap :w:make imap :!time ./%< imap :w:make:!time ./%< " Curly bracket autocomplete function! CurlyBracketComplete() if getline('.') =~ '\s*\<\(class\)|\(struct\)\>.*' return "{\};\O" else return "{\}\O" endfunction inoremap { =CurlyBracketComplete() " Tab autocomplete function! TabComplete() if col('.') > 1 && strpart(getline('.'), col('.')-2, 3) =~ '^\w' return "\" else return "\" endfunction set completeopt=longest,menu inoremap =TabComplete()