aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/whitespace-method-chain
diff options
context:
space:
mode:
authorTeddy Wing2017-05-04 22:14:47 +0200
committerTeddy Wing2017-05-04 22:14:47 +0200
commit10a7bb10faec636f8aa5c06ea086ddbad01665d3 (patch)
tree2d3cb417155a6140aa0f1ff2eea9a41e82b0764a /bundle/whitespace-method-chain
parent30d907fd205daa02fd32a4c367602a457fe9b399 (diff)
downloaddotvim-10a7bb10faec636f8aa5c06ea086ddbad01665d3.tar.bz2
Rename 'whitespace-chain' to 'whitespace-method-chain'
Give the plugin a clearer name.
Diffstat (limited to 'bundle/whitespace-method-chain')
-rw-r--r--bundle/whitespace-method-chain/plugin/whitespace_method_chain.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/bundle/whitespace-method-chain/plugin/whitespace_method_chain.vim b/bundle/whitespace-method-chain/plugin/whitespace_method_chain.vim
new file mode 100644
index 0000000..5ba523d
--- /dev/null
+++ b/bundle/whitespace-method-chain/plugin/whitespace_method_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