Skip to content

Instantly share code, notes, and snippets.

@zapu
Created July 27, 2016 15:46
Show Gist options
  • Save zapu/b5fcb64b63ad8e05dec372b7123689ed to your computer and use it in GitHub Desktop.
Save zapu/b5fcb64b63ad8e05dec372b7123689ed to your computer and use it in GitHub Desktop.
A tiny "good defaults" .vimrc, for use when I have to use vim on some server that I need to reconfigure, and there is no good .vimrc present.
syntax on
" indents, whitespace
set autoindent " keep indenting on newlines
set tabstop=4 "
set shiftwidth=4 " one tab = four spaces (autoindent)
set softtabstop=4 " one tab = four spaces (tab key)
set smarttab "
set expandtab " don't use hard tabs
set fileformats=unix,dos " new files starts with unix linebreaks
" Soft word wrapping
set wrap
set linebreak
" jk will traver through soft lines instead of hard lines
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gkk
" Search
set ignorecase
set smartcase " case-ins search, unless there are capitals
set gdefault " s///g by default
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment