Skip to content

Instantly share code, notes, and snippets.

@Ruakker
Last active November 2, 2021 05:43
Show Gist options
  • Save Ruakker/db4e45ee052f11e39af172f0955e2625 to your computer and use it in GitHub Desktop.
Save Ruakker/db4e45ee052f11e39af172f0955e2625 to your computer and use it in GitHub Desktop.
Vim config for NOIP
set nu
set rnu
set autochdir
set autoread
set cindent
filetype on
filetype indent on
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab
set mouse=a
set shortmess=atI
set backspace=eol,indent,start
set hlsearch
set incsearch
" set ruler
set laststatus=2
set nowrap
syntax on
inoremap {<cr> {<cr>}<esc>O
map <F5> :call CompileWithUndebug()<CR>
map <F6> :call CompileWithDebug()<CR>
map <F7> :call Compile()<CR>
map <F8> :call Run()<CR>
map <F9> :call RunShell()<CR>
map <F10> :call RunPython3()<CR>
func! CompileWithUndebug()
exec "w"
exec "!g++ % -o %< -lm -std=c++14 -Wall -O2 -UDEBUG"
endfunc
func! CompileWithDebug()
exec "w"
exec "!g++ % -o %< -lm -std=c++14 -Wall -DDEBUG -g -fsanitize=undefined"
endfunc
func! Compile()
exec "w"
exec "!g++ % -o %< -lm -std=c++14 -Wall -O2 -DDEBUG"
endfunc
func! Run()
exec ":!./%<"
endfunc
func! RunShell()
exec "w"
exec "!sh ./%"
endfunc
func! RunPython3()
exec "w"
exec "!python3 ./%"
endfunc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment