luke-gru / riml

Riml is a subset of VimL with some nice added features. It compiles to plain VimL.
MIT License
224 stars 6 forks source link

End blocks #1

Closed goldfeld closed 11 years ago

goldfeld commented 11 years ago

First of all I love what you're doing, and hope to get at least one plugin done in Riml soon to get a feel for the compiling workflow. Regarding the syntax, I presume the 'end' statements are necessary? It would be great if they were optional, but if they aren't I have to say I prefer Vimscript's native blocks, because they are self-documenting what they are closing, whereas in the current Riml syntax we end up with the sort of confusing "what is this closing?" doubts you get in languages like Python and HTML4, for instance.

luke-gru commented 11 years ago

Hey, thanks for the encouragement!

I do hope to write a vim plugin soon using Riml, just a question of getting around to it :smile: Also, I plan on documenting it more thoroughly and am just finishing up with a vim-riml syntax colorer script so vim users will feel at home.

As for the syntax, all the sugary syntax parts are completely optional, so you can (presumably... with a few pitfalls that need documenting) compile any old vim plugin with Riml and it will basically spit out equivalent Vimscript.

In the tests, if you take a look at test/integration/*, you'll see I did just that with @tpope's pathogen plugin and another plugin called smartinput (which you should check out if you haven't already).

Feel free to ask me anything, and of course, to contribute :wink:

Edit: I misread your comment as 'I hope you get around to doing at least one plugin', freudian slip ..? Let me know when you get around to it, and send me a link.

goldfeld commented 11 years ago

Well that sounds good to me. I'll confess one of the (silly) reasons I would like using Riml is for keeping my riml files in a src folder, all organized and split up into logical units, and then have it compile it all into a single production VimL file (or autoload and plugin files). Don't know if your compiler currently has that option, that's why I'm saying--that'd be pretty cool.

And yeah I meant a plugin from me, but one from you would be cool too.

luke-gru commented 11 years ago

Hey, just worked a bit on the 'include' functionality you were talking about, to compile everything into 1 VimL file.

Basically, if you have main.riml, class1.riml and class2.riml, and class1 inherits from class2, here's what you do to end up with a file 'main.vim' that will have all VimL from these files included in the proper order.

in main.riml

riml_include 'class1.riml'
" I can now use Class1, even if it depends on Class2

in class1.riml

riml_include 'class2.riml' " Class1 inherits from Class2, so Class2 must be included before I define Class1
" ... code that defines Class1

in class2.riml

class Class2
  " ...
end

To compile main.vim, go the directory where these files reside and type 'riml -c main.riml'. For this to work, you'll need the new Riml version (>= 0.2.0)

Thanks!

goldfeld commented 11 years ago

Looking really good, thanks! I'll see if I can get some time with it on the weekend.