I do quite often use this mapping:autocmd FileType cpp nnoremap <buffer> == :%!clang-format -style=file<cr>2g;zzIt reindents the whole file and returns the cursor to the last edit position.Problem is, if I have folds, they get closed. All of them.How do I keep each fold's state after this command? Some suggest saving a session, but this seems inefficient, and in my case I neither close the file nor leave vim. 
How do I keep folds when formatting (reindenting) the whole file?
key bindings;vimscript;indentation;external command;folding