aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/whitespace-method-chain/autoload
diff options
context:
space:
mode:
authorTeddy Wing2017-05-04 22:17:38 +0200
committerTeddy Wing2017-05-04 22:17:38 +0200
commit1c2a58930e368b101e5aae39f469aea0a0f9920d (patch)
treee1e77097160396e01060cd0c76e56491aa66133f /bundle/whitespace-method-chain/autoload
parent10a7bb10faec636f8aa5c06ea086ddbad01665d3 (diff)
downloaddotvim-1c2a58930e368b101e5aae39f469aea0a0f9920d.tar.bz2
whitespace-method-chain: Move function to autoload
Don't force the function to load on startup.
Diffstat (limited to 'bundle/whitespace-method-chain/autoload')
-rw-r--r--bundle/whitespace-method-chain/autoload/whitespace_method_chain.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/bundle/whitespace-method-chain/autoload/whitespace_method_chain.vim b/bundle/whitespace-method-chain/autoload/whitespace_method_chain.vim
new file mode 100644
index 0000000..9e7e00b
--- /dev/null
+++ b/bundle/whitespace-method-chain/autoload/whitespace_method_chain.vim
@@ -0,0 +1,12 @@
+function! whitespace_method_chain#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