diff options
-rw-r--r-- | bundle/whitespace-chain/plugin/whitespace_chain.vim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bundle/whitespace-chain/plugin/whitespace_chain.vim b/bundle/whitespace-chain/plugin/whitespace_chain.vim new file mode 100644 index 0000000..5ba523d --- /dev/null +++ b/bundle/whitespace-chain/plugin/whitespace_chain.vim @@ -0,0 +1,12 @@ +function! SplitMethodChainToMultipleLines() + normal! m` + + let line = getline('.') + let indent = matchstr(line, '\v^\s+') + + " Replace '.' with newlines and the correct amount of indentation + substitute/\V./\='
' . indent . '.'/g + + " Indent new lines + '`+1,.> +endfunction |