Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial coffeescript support -- Functions

  • Loading branch information...
commit 4d3a147d2097d1d9e82355fcdb2c917339864a91 1 parent e8f45ea
@AndrewRadev authored
View
22 autoload/sj/coffee.vim
@@ -0,0 +1,22 @@
+function! sj#coffee#SplitFunction()
+ let line = getline('.')
+
+ if line !~ '->'
+ return 0
+ else
+ s/->\s*/->\r/
+ normal! ==
+ return 1
+ endif
+endfunction
+
+function! sj#coffee#JoinFunction()
+ let line = getline('.')
+
+ if line !~ '->'
+ return 0
+ else
+ s/->\_s\+/-> /
+ return 1
+ endif
+endfunction
View
1  examples/test.coffee
@@ -0,0 +1 @@
+(foo, bar) -> console.log foo
View
11 ftplugin/coffee/splitjoin.vim
@@ -0,0 +1,11 @@
+if !exists('b:splitjoin_split_callbacks')
+ let b:splitjoin_split_callbacks = [
+ \ 'sj#coffee#SplitFunction',
+ \ ]
+endif
+
+if !exists('b:splitjoin_join_callbacks')
+ let b:splitjoin_join_callbacks = [
+ \ 'sj#coffee#JoinFunction',
+ \ ]
+endif
Please sign in to comment.
Something went wrong with that request. Please try again.