Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
97 lines (75 sloc) 2.15 KB
set nocompatible
" Pathogen *****************************************************************
call pathogen#infect()
syntax enable
set background=light
set number
set ruler
" Set encoding
set encoding=utf-8
" Whitespace stuff
set wrap
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set list listchars=tab:\ \ ,trail:·
set smartindent
" Searching
set hlsearch
set incsearch
set ignorecase
set smartcase
" Tab completion
set wildmode=list:longest,list:full
set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
" Status bar
set laststatus=2
" File opening/handling
" (
map ,e :e <C-R>=expand("%:p:h") . "/" <CR>
map ,t :tabe <C-R>=expand("%:p:h") . "/" <CR>
map ,s :split <C-R>=expand("%:p:h") . "/" <CR>
" Colors
let g:solarized_termcolors=256
let &t_Co=256 " 256 colors
colorscheme solarized
" Disable arrow keys
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
imap <up> <nop>
imap <down> <nop>
imap <left> <nop>
imap <right> <nop>
" Let me edit my crontab!
" (
set backupskip=/tmp/*,/private/tmp/*
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" load the plugin and indent settings for the detected filetype
filetype plugin indent on
" Syntax highlighting for React files
au BufNewFile,BufRead *.react set filetype=javascript
" Highlight the 80th column
set colorcolumn=80
" Plugins ******************************************************************
" NERDCommenter
let NERDDefaultNesting = 0
let NERDRemoveExtraSpaces = 1
let NERDSpaceDelims = 1
" Ruby
if !empty($MY_RUBY_HOME)
let g:ruby_path = join(split(glob($MY_RUBY_HOME.'/lib/ruby/*.*')."\n".glob($MY_RUBY_HOME.'/lib/ruby/site_ruby/*'),"\n"),',')
" Functions *******************************************************************
" Remove trailing whitespaces in files
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\t/ /ge
call cursor(l, c)
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()