Skip to content

Instantly share code, notes, and snippets.

@shmup
Last active August 29, 2015 14:19
Show Gist options
  • Save shmup/16e2c9e2db2fe8562c99 to your computer and use it in GitHub Desktop.
Save shmup/16e2c9e2db2fe8562c99 to your computer and use it in GitHub Desktop.
a very minimal .vimrc
set nocompatible " use vim settings instead of vi settings
filetype plugin indent on " enable file type detection and do language-dependent indenting
syntax on " switch syntax highlighting oe it is there
set backspace=indent,eol,start " sane backspace behavior
set smarttab " tab and backspace are smart
set number " line numbers
set autoindent " use indentation of previous line
set showmatch " show matching braces
set tabstop=4 " tab width is 4 spaces
set shiftwidth=4 " indent also with 4 spaces
set expandtab " expand tabs to spaces
set ignorecase " case insensitive search
set smartcase " case-sensitive search if query contains caps
set hlsearch " highlight search results
set incsearch " search as you type
set wildmenu " menu has tab completion
set wildmode=longest:full,full " comfortable menu tab settings
set hidden " automatically hide buffers with unsaved changes
set laststatus=2 " always show a status line
set ruler " show the line number on the status line
silent! colorscheme elflord " use elflord colorscheme if you have it
@shmup
Copy link
Author

shmup commented Apr 15, 2015

Q) When I paste text from outside vim, autoindent makes it paste funky

A) You need to enable paste mode. You can bind something to toggle it or just manually adjust:

toggle
set pastetoggle=<Ins> " toggle paste mode

manual
:set paste
:set nopaste

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment