"make vim save and load the folding of the document each time it loads "also places the cursor in the last place that it was left. if has("autocmd") au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif