krc /.vimrc

My .vimrc One of my most valued dotfiles, along with my bash setup.
set encoding=utf-8	" Use UTF-8   Go Unicode!
set showmode		" always show current mode
set magic		" extended regexps - use \v for very-magic

" tell vim to shut up
set noerrorbells	" Doesn't work, maybe needed for next part?
set visualbell		" use screen flash instead of bells
set t_vb=		" set screen flash control char to nothing

" some options for gvim
set guifont=dejavu\ sans\ mono\ 10
highlight Normal guibg=black guifg=lightgrey

" set Ctrl-n and Ctrl-p to next and previous buffer
nnoremap   ":silent bnext"
nnoremap   ":silent bprevious"

" turn spelling on and off. bang (!) toggles
map   ":silent setlocal spell!"

" paste mode
set pastetoggle=  

" make home and end work
map  ^
map  $


" syntax related. background=dark makes the syntax colorizer use colors
" appropriate for a dark background
set background=dark
syntax enable

" 1  = 4 spaces, 2 s = 1 tab (size of 8 spaces)
set tabstop=8
set shiftwidth=4
set softtabstop=4

" Shift-Tab inserts a real tab
" inoremap  

" use elinks to view current file - broken, how to fix?
map  :!elinks file://%
command View :!elinks file://% 


" enable markdown markdown detection and syntax plugin 
augroup mkd
    autocmd BufRead *.mkd  set ai formatoptions=tcroqn2 comments=n:>
augroup END

" enable reading of doc, pdf, ps and odt in vim based on extension
autocmd BufReadPre *.pdf set ro
autocmd BufReadPost *.pdf silent %!pdftotext -nopgbrk "%" - |fmt -csw78

autocmd BufReadPre *.ps set ro
autocmd BufReadPost *.ps silent %!pdftotext -nopgbrk "%" - |fmt -csw78

autocmd BufReadPre *.doc set ro
autocmd BufReadPost *.doc silent %!antiword "%" 

autocmd BufReadPre *.odt set ro
autocmd BufReadPost *.odt silent %!odt2txt "%"