Skip to content

Instantly share code, notes, and snippets.



Created Oct 26, 2011
What would you like to do?
Piotr's .vimrc
if $SHELL =~ 'bin/fish'
set shell=/bin/sh
" Needed on some linux distros.
" see
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
filetype plugin indent on
let mapleader=","
let g:erlangFold=0
let g:syntastic_enable_signs=1
let g:syntastic_quiet_warnings=1
" NERDTree configuration
let NERDTreeIgnore=['\.rbc$', '\~$']
" Command-T configuration
let g:CommandTMaxHeight=20
" Vim Indent Guides
let g:indent_guides_enable_on_vim_startup=1
set nocompatible
set t_Co=256
set encoding=utf-8 nobomb " BOM often causes trouble
set backupdir=/tmp
set directory=/tmp
set number
" Tab Settings {{{
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
" }}}
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest,list:full
set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,*.beam,vendor/gems/*
set wildignore+=*.jpg,*.jpeg,*.gif,*.png,*.gif,*.psd
set wildignore+=.sass-cache
set visualbell
set cursorline
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
set list
set listchars=tab:▸\ ,eol:¬,trail:·
set background=dark
set wrap
set textwidth=79
set formatoptions=qrn1
if exists("+undodir")
set undodir=/tmp
set undofile
if exists("+colorcolumn")
set colorcolumn=85
if exists("+fuoptions")
set fuoptions=maxhorz,maxvert
if exists("+relativenumber")
set relativenumber
au BufReadPost * set relativenumber
" Use modeline overrides
set modeline
set modelines=10
colorscheme solarized
nnoremap / /\v
vnoremap / /\v
nnoremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap j gj
nnoremap k gk
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
map <C-a>a :Align =
map <leader>d :execute 'NERDTreeToggle ' . getcwd()<CR>
map <leader>o :execute 'CommandT ' . getcwd()<CR>
" Shortcut to jump to next conflict marker
nmap <silent> <leader>c /^\(<\\|=\\|>\)\{7\}\([^=].\+\)\?$<CR>
set statusline=
set statusline +=\ %n\ "buffer number
set statusline +=%{&ff} "file format
set statusline +=%y "file type
set statusline +=\ %<%F "full path
set statusline +=\ %{fugitive#statusline()}
set statusline +=%m "modified flag
set statusline +=%=%5l "current line
set statusline +=/%L "total lines
set statusline +=%4c\ "column number
set statusline +=0x%04B\ "character under cursor
set statusline +=%{SyntasticStatuslineFlag()}
highlight ExtraWhitespace ctermbg=red guibg=red
match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
match ExtraWhitespace /\s\+\%#\@<!$/
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
autocmd InsertLeave * redraw!
autocmd FileType erlang set tabstop=4 shiftwidth=4 softtabstop=4 expandtab
autocmd FileType make set noexpandtab
" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
autocmd BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,} set ft=ruby expandtab
" make python follow PEP8 ( )
autocmd FileType python set tabstop=4 textwidth=79
" Remove trailing whitespace on save
autocmd BufWritePre * :%s/\s\+$//e
" Change tabs to spaces on save
autocmd BufWritePre * :retab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment