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

Riml import #23

Closed luke-gru closed 11 years ago

luke-gru commented 11 years ago

This is in master (0.3.4) now.

It works like this:

riml_import Lib1, Lib2

then we can use classes g:Lib1 and g:Lib2, and we can even inherit from them.

Also, we can pass strings to riml_import, but these strings must have a * character somewhere in them. Ex:

riml_import 'MyLib*'

Now, every global class that starts with MyLib is automatically imported upon use. We can now do:

l = new g:MyLib() or h = new g:MyLibHelpers()

There is also a commandline option --allow-undef-global-classes. All this does it adds the following:

riml_import '*'

Now, all global classes that aren't defined are imported upon use.

All this will appear in the README shortly.

dsawardekar commented 11 years ago

I'm liking this. Would make the development of Portkey extensions a lot nicer. Extensions should be able to pull in utilities from Core that would otherwise require copy-paste driven development. Nice work!