Skip to content

Instantly share code, notes, and snippets.

@ironhouzi
Last active December 20, 2015 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ironhouzi/6070843 to your computer and use it in GitHub Desktop.
Save ironhouzi/6070843 to your computer and use it in GitHub Desktop.
Basic vimrc
set nocp " use vim settings instead of vi - MUST BE 1ST LINE!
" set pathogen plugin which helps installing plugins and runtime files
execute pathogen#infect()
set encoding=utf-8
set fileencoding=utf-8
scriptencoding utf-8
let mapleader = ","
syntax on " enable syntax highlighting
set showcmd " display incomplete commands
filetype plugin indent on " load file type plugins + indentation
set nowrap
set hls
set number
set wm=2
set backspace=indent,eol,start " backspace through everything in insert mode
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
set hidden " for troubleshooting: http://vim.wikia.com/wiki/Troubleshooting#vimrc
set modeline
"set sidescroll=3
"set listchars+=precedes:<,extends:>
"
set autoindent " indent at the same level of the previous line
set nosmartindent
set nomodeline
set wildmenu " tab completion
set pastetoggle=<F12> " pastetoggle (sane indentation on pastes)
set scrolloff=5 " scrolls 5 lines before reaching the very top or bottom
set sidescroll=2 " only scroll horizontally little by little
set ttyfast " improves redrawing for newer computers
set tabstop=4 " tabs are 4 characters long
set shiftwidth=4 " < and > use indents of 4 spaces
set softtabstop=4 " let backspace delete indent
set expandtab " tabs are spaces, not tabs
set incsearch " highlights searches for efficient movement
" Different settings for html files
autocmd FileType html,xml :setlocal sw=2 ts=2 sts=2
autocmd FileType python :setlocal ts=8 et sw=4 sts=4
" ---------------------------------------
" stop creation of files with ~ extension
" ---------------------------------------
set backupdir-=. " stop saving backups in local dir
set backupdir^=~/tmp,/tmp
set directory=~/tmp//,. " set swapfile dir
" ---------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment