map <F3> :w<cr>:mak<cr>
map! <F3> <esc>:w<cr>:mak<cr>
map <F2> :w<cr>a
map! <F2> <esc>:w<cr>a
map <F4> <esc>:next<cr>
map! <F4> <esc>:next<cr>
map <F9> <esc>:!./%<<cr>
map <F10> <esc>:!cat 
map! <F9> <esc>:!./%<<cr>
map! <F10> <esc>:!cat 
map <F11> <esc>:!./%<

set nocompatible
set backspace=indent,eol,start


syntax on
set autoindent
set smartindent
set cindent
set ruler
set makeprg=g++\ -O2\ -lm\ -Wall\ -static\ -o\ %<\ %
set tabstop=4
set softtabstop=4
set shiftwidth=4
set showmatch
" set background=light
set background=dark
set mouse=a

" din configul lui Dan
if has("autocmd")
  " When editing a file, always jump to the last cursor position
  autocmd BufReadPost *
  \ if line("'\"") > 0 && line ("'\"") <= line("$") |
  \   exe "normal g'\"" |
  \ endif
endif

map ; :call ChangeColor()<cr>
function! ChangeColor()
	if (&bg == "light")
		let g:col="dark"
	else
		let g:col="light"
    endif
    silent exec 'set bg=' . g:col
endfunction

function! OpenFiles()
    vsplit
    wincmd l
    vert res 30
    e %<.out
    split
    e %<.in
endfunction
map <F6> :call OpenFiles() <cr>

