dotfiles/.vimrc
2016-04-16 16:31:54 +02:00

90 lines
2.1 KiB
VimL

set nocompatible
" Initialize Pathogen
runtime bundle/vim-pathogen/autoload/pathogen.vim
execute pathogen#infect()
" Enable syntax highlighting
syntax on
filetype plugin indent on
" Colorscheme see https://github.com/hukl/Smyck-Color-Scheme
color smyck
" Add line numbers
set number
set ruler
" Set encoding
set encoding=utf-8
" Whitespace stuff
set nowrap
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
" Show trailing spaces and highlight hard tabs
set list listchars=tab:»·,trail
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" Strip trailing whitespaces on each save
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
" Search related settings
set incsearch
set hlsearch
" Map Ctrl+l to clear highlighted searches
nnoremap <silent> <C-l> :<C-u>nohlsearch<CR><C-l>
" Highlight characters behind the 80 chars margin
:au BufWinEnter * let w:m2=matchadd('ColumnMargin', '\%>80v.\+', -1)
" Disable code folding
set nofoldenable
" Directories for swp files
set backupdir=~/.vimbackup
set directory=~/.vimbackup
" NERDTree configuration
let NERDTreeIgnore=['\.pyc$', '\.rbc$', '\~$']
map <Leader>n :NERDTreeToggle<CR>
" make uses real tabs
au FileType make set noexpandtab
" Erlang uses 4 spaces
au FileType erlang set softtabstop=4 tabstop=4 shiftwidth=4
" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
" add json syntax highlighting
au BufNewFile,BufRead *.json set ft=javascript
" make Python follow PEP8 ( http://www.python.org/dev/peps/pep-0008/ )
au FileType python set softtabstop=4 tabstop=4 shiftwidth=4 textwidth=79
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" ctrp custom ignores
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.hg$\|\.svn$\|\.eunit$',
\ 'file': '\.exe$\|\.so$\|\.dll\|\.beam$\|\.DS_Store$'
\ }
let g:erlangCheckFile = "~/.vim/bundle/vimerl/compiler/erlang_check_file.erl"
let g:erlangHighlightErrors = 1