Skip to content

Instantly share code, notes, and snippets.

@bendc
Created November 21, 2014 10:36
Show Gist options
  • Save bendc/3e0ab3543499f821fb92 to your computer and use it in GitHub Desktop.
Save bendc/3e0ab3543499f821fb92 to your computer and use it in GitHub Desktop.
.vimrc
set nocompatible
set encoding=utf-8 nobomb
" enable syntax highlighting and line numbers
syntax on
set number
" color scheme
let g:solarized_termtrans=1
set background=dark
colorscheme solarized
" soft tabs ftw
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set autoindent
" wrap text
set tw=100
set formatoptions+=t
" Ignore case of searches
set ignorecase
" Highlight dynamically as pattern is typed
set incsearch
" show the filename in the window titlebar
set title
" Don’t reset cursor to start of line when moving around
set nostartofline
" show the (partial) command as it’s being typed
set showcmd
" strip trailing spaces
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment