" (happens when dropping a file on gvim).
   " Also don't do it when the mark is in the first line, that is the default
   " position when opening a file.
+  " blacklist certain filetype, you can get a file type with :echo &ft
+  let blacklist = ['gitcommit']
   autocmd BufReadPost *
-    \ if line("'\"") > 1 && line("'\"") <= line("$") |
+    \ if index(blacklist, &ft) < 0 && line("'\"") > 1 && line("'\"") <= line("$") |
     \   exe "normal! g`\"" |
     \ endif
 
 set expandtab
 
 set showbreak=▒▒
+" show these chars for tabs and trailing spaces
+set list listchars=tab:»·,trail:·
 
 set pastetoggle=<F11>
 " split right when using :vsp
 " Press `` to toggle insert and replace mode (no <Insert> key on Mac keyboard)
 imap `` <Insert> 
 
+" fold between {{{ }}}
+set foldmethod=marker
+set foldlevelstart=99
+" space will toggle current fold in normal mode, if not in a fold, normal
+" behaviour
+nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
+vnoremap <Space> zf
+" save and restore folds
+autocmd BufWinLeave *.* mkview
+autocmd BufWinEnter *.* silent loadview
+
 " Jump to the next or previous line that has the same level or a lower
 " level of indentation than the current line.
 "