Skip to content

Instantly share code, notes, and snippets.

@ethagnawl
Last active September 11, 2018 05:07
Show Gist options
  • Save ethagnawl/3ee7393a011782a06b0cd7d05aa450a8 to your computer and use it in GitHub Desktop.
Save ethagnawl/3ee7393a011782a06b0cd7d05aa450a8 to your computer and use it in GitHub Desktop.
format comic list entries
function! InsertHyphensAndUnderscores()
execute "normal! i- wi_f#gea_"
endfunction
function! InsertEmptyLines()
silent g/.\n\n\@!/norm o
endfunction
function! FormatComicListEntries()
execute "normal! gg^VG:sort\<CR>"
execute "normal! gg^VG:call InsertHyphensAndUnderscores()\<CR>"
execute "normal! gg^VG:call InsertEmptyLines()\<CR>"
endfunction
nnoremap <leader>fc :call FormatComicListEntries()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment