Dotfiles/.vimrc

81 lines
1.8 KiB
VimL
Raw Normal View History

set nocompatible
" Initialize Pathogen
call 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()
" 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
" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
" md, markdown, and mk are markdown and define buffer-local preview
au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn} call s:setupMarkup()
" add json syntax highlighting
au BufNewFile,BufRead *.json set ft=javascript
au BufRead,BufNewFile *.txt call s:setupWrapping()
" 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