" Taken from https://github.com/salcode/vim-interactive-rebase-reverse " Reverse the order of all lines that do NOT: " - Begin with # " - nor are a blank link function! s:Reverse() global!/\(^#\)\|\(^$\)/m0 endfunction " Reverse the order of all commits in the git interactive rebase screen, " when this filetype (gitrebase) is loaded. call s:Reverse() " Set an autocmd to run when the Buffer is written augroup fe_interactive_rebase_reverse autocmd! " Before saving (un)reverse the order of all commits. autocmd BufWritePre call s:Reverse() " After saving reverse the order of the commits again. autocmd BufWritePost call s:Reverse() augroup END " See https://github.com/neovim/neovim/blob/master/runtime/ftplugin/gitrebase.vim nnoremap p :Pick nnoremap s :Squash nnoremap e :Edit nnoremap r :Reword nnoremap f :Fixup nnoremap c :Cycle setlocal bufhidden=wipe