Re-indent entire buffer

3 Points

chechoRP chechoRP

4 years ago

Look at the title of this snippet :) ... One caveat, it doesn't keep the cursor position when triggered

" Re-indent entire buffer
nnoremap <leader>i gg=G

Cameron Durham

Cameron Durham 7 months ago

If you wanted to return...

map <leader><leader>i mmgg=G`m