" Set VIM mode
set nocompatible
set textwidth=80
set wildmenu
set mouse=a

" UI settings
set backspace=eol,start,indent
set whichwrap+=<,>,h,l

set wildignore+=*.bak,*~,*.a,*.o,*.so,*.out
set wildignore+=*.cmi,*.cmo,*.cma,*.cmx,*.cmxa
set wildignore+=*.beam

set lazyredraw

" Status line settings
set statusline=%=%m%r%h\ %-16.(%l,%v%)\ %P
set laststatus=2
set showcmd
set ruler

" Buffer handling
set hidden
set switchbuf=useopen,usetab,newtab

" Tab settings
set expandtab
set tabstop=4
set smarttab

" Indent settings
set autoindent
set shiftwidth=4

" Backup settings
set backupdir=~/.vim/backup,/tmp
set nobackup
set nowritebackup
set noswapfile

" Syntax highlighting support
filetype plugin on
filetype indent on
syntax on

" Omni completion
set omnifunc=syntaxcomplete#Complete

" Search settings
set showmatch
set hlsearch
set incsearch

" Color scheme & EOL highlighting
colorscheme baycomb
highlight EOLWhitespaces ctermbg=red guibg=red
match EOLWhitespaces /\s\+$/

" Delete trailing whitespaces
func! DeleteTrailingWS()
  exe "normal mz"
  exe "normal `z"
autocmd BufWrite * :call DeleteTrailingWS()

" Keybindings
map <F9>  :bprev<CR>
map <F10> :bdelete<CR>
map <F11> :bnext<CR>

map <localleader>diff :VCSDiff
map <localleader>ci   :VCSCommit

" Disable some of the plugins
let loaded_minibufexplorer = 1

" `buftabs` settings
let g:buftabs_only_basename = 1
let g:buftabs_in_statusline = 1
let g:buftabs_active_highlight_group = "Visual"
let g:buftabs_separator = " "
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License