When I copy code from another file, the formatting is messed up, like this:
fun() { for(...) { for(...) { if(...) { } } } }
How can I autof
The plugin vim-autoformat lets you format your buffer (or buffer selections) with a single command: https://github.com/Chiel92/vim-autoformat. It uses external format programs for that, with a fallback to vim's indentation functionality.