Created
September 8, 2011 17:02
-
-
Save vpetro/1203926 to your computer and use it in GitHub Desktop.
function to put function parameters one-per-line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" NOTES: | |
" ^M must be replaced with <ctrl-v><ctrl-m> | |
" ^[ must be replace with <ctl-v><esc> | |
function! BreakParameters() | |
" move the start of the line and set a mark 'a' | |
normal ^ma | |
" get break the parameters onto their own line | |
normal f(a^M^[ | |
" replace the commas with linebreaks | |
:s/\v,[\s\n]?/,^M/g | |
" reformat the paragraph | |
normal V`'= | |
" clean up by deleting the mark | |
:delmarks a | |
" turn off the highlighting | |
:nohl | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment