Skip to content

Instantly share code, notes, and snippets.

@mildronize
Last active December 18, 2020 09:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mildronize/e9a661ccb6234746ca8ac5f1875b2519 to your computer and use it in GitHub Desktop.
Save mildronize/e9a661ccb6234746ca8ac5f1875b2519 to your computer and use it in GitHub Desktop.
Minimal .vimrc for ACM-ICPC
set nocompatible " use vim, not vi api
syntax on " enable syntax processing
set number " show line numbers
set tabstop=4 " number of visual spaces per TAB
set softtabstop=4 " number of spaces in tab when editing
set autoindent " Indent at the same level of the previous line
set smartindent " If you wnat to paste in INSERT MODE, press `F5` (PASTE toggle)
set pastetoggle=<F5>
set smarttab
set shiftwidth=4 " Use indents of 4 spaces
" Optional
set cursorline " highlight current line
set expandtab " tabs are spaces
set incsearch " search as characters are entered
" jk is escape
inoremap jk <esc>
inoremap kj <esc>
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" or set no wrapping
set nowrap
set laststatus=2 " always show the status bar

Vim Cheat Sheet

Some tips about autocomplete

  • Complete by keyword in current file: <CTRL-n> or <CTRL-p>
  • Complete by keyword in current file and included files: <CTRL-x> + <CTRL-i>
  • Complete Whole line: <CTRL-x> + <CTRL-l>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment