Skip to content

Commit 3ce8843

Browse files
committed
Implement plugin management entirely using MoonScript/Lua
Also now implemented various ways of lazy-loading plugins, woo. Mostly picked up the details for all this stuff by reading the source of vim-plug.
1 parent 6497d65 commit 3ce8843

File tree

12 files changed

+783
-497
lines changed

12 files changed

+783
-497
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Explicit caching of manual/options.md rebuilds
22
options.sha256
3+
scratch

.luacheckrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ignore = { "213", "631" }
2+
read_globals = {
3+
"vim"
4+
}
5+
globals = {
6+
"envy"
7+
}

docs/options.html

Lines changed: 48 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -182,23 +182,6 @@ <h3 id="basevimplugins"><a class="header" href="#basevimplugins"><code>baseVimPl
182182
</div>
183183
</div>
184184
<div class="option">
185-
<h3 id="earlyconfig"><a class="header" href="#earlyconfig"><code>earlyConfig</code></a></h3>
186-
<div class="option_description">
187-
<p>Extra lines of <code>init.vim</code> configuration that need to be as early as possible in
188-
the file.</p>
189-
</div>
190-
<div class="option_properties">
191-
<ul>
192-
<li>
193-
<p><em>Type:</em> strings concatenated with &quot;\n&quot;</p>
194-
</li>
195-
<li>
196-
<p><em>Default:</em> <code>&quot;&quot;</code></p>
197-
</li>
198-
</ul>
199-
</div>
200-
</div>
201-
<div class="option">
202185
<h3 id="extrabinpackages"><a class="header" href="#extrabinpackages"><code>extraBinPackages</code></a></h3>
203186
<div class="option_description">
204187
<p>A list of derivations containing executables that need to be available in the
@@ -471,7 +454,7 @@ <h3 id="pluginregistry"><a class="header" href="#pluginregistry"><code>pluginReg
471454
enable = false;
472455
# Decide whether or not to load at run-time based on the result of
473456
# a VimL expression
474-
nvimrc.condition = &quot;executable('moonc')&quot;;
457+
condition = &quot;executable('moonc')&quot;;
475458
};
476459

477460
vim-auto-save = {
@@ -483,7 +466,7 @@ <h3 id="pluginregistry"><a class="header" href="#pluginregistry"><code>pluginReg
483466
nerdtree = {
484467
enable = true;
485468
# Lazily load on command usage
486-
on = &quot;NERDTreeToggle&quot;;
469+
on_cmd = &quot;NERDTreeToggle&quot;;
487470
nvimrc.postPlugin = ''
488471
&quot; Prettify NERDTree
489472
let NERDTreeMinimalUI = 1
@@ -627,6 +610,26 @@ <h3 id="pluginregistrynamecommit"><a class="header" href="#pluginregistrynamecom
627610
</div>
628611
</div>
629612
<div class="option">
613+
<h3 id="pluginregistrynamecondition"><a class="header" href="#pluginregistrynamecondition"><code>pluginRegistry.&lt;name&gt;.condition</code></a></h3>
614+
<div class="option_description">
615+
<p>A VimL expression that will be evaluated to determine whether or not to execute
616+
the vim-plug 'Plug' command for this plugin (which will typically load the
617+
plugin, or configure it to be lazily loaded).</p>
618+
<p>Leave null in order to unconditionally always run the 'Plug' command for this
619+
plugin.</p>
620+
</div>
621+
<div class="option_properties">
622+
<ul>
623+
<li>
624+
<p><em>Type:</em> null or string</p>
625+
</li>
626+
<li>
627+
<p><em>Default:</em> <code>null</code></p>
628+
</li>
629+
</ul>
630+
</div>
631+
</div>
632+
<div class="option">
630633
<h3 id="pluginregistrynamedependencies"><a class="header" href="#pluginregistrynamedependencies"><code>pluginRegistry.&lt;name&gt;.dependencies</code></a></h3>
631634
<div class="option_description">
632635
<p>List of other vim plugins that are dependencies of this plugin.</p>
@@ -668,6 +671,24 @@ <h3 id="pluginregistrynamedir"><a class="header" href="#pluginregistrynamedir"><
668671
</div>
669672
</div>
670673
<div class="option">
674+
<h3 id="pluginregistrynameextraconfig"><a class="header" href="#pluginregistrynameextraconfig"><code>pluginRegistry.&lt;name&gt;.extraConfig</code></a></h3>
675+
<div class="option_description">
676+
<p>Extra lines of <code>init.vim</code> configuration associated with this plugin, that need
677+
to be executed after the plugin loading.</p>
678+
<p>Leave null if no such extra configuration is required.</p>
679+
</div>
680+
<div class="option_properties">
681+
<ul>
682+
<li>
683+
<p><em>Type:</em> null or strings concatenated with &quot;\n&quot;</p>
684+
</li>
685+
<li>
686+
<p><em>Default:</em> <code>null</code></p>
687+
</li>
688+
</ul>
689+
</div>
690+
</div>
691+
<div class="option">
671692
<h3 id="pluginregistrynamefor"><a class="header" href="#pluginregistrynamefor"><code>pluginRegistry.&lt;name&gt;.for</code></a></h3>
672693
<div class="option_description">
673694
<p>One or more filetypes that should trigger on-demand loading of this plugin.</p>
@@ -724,84 +745,27 @@ <h3 id="pluginregistrynamemergeable"><a class="header" href="#pluginregistryname
724745
</div>
725746
</div>
726747
<div class="option">
727-
<h3 id="pluginregistrynamenvimrccondition"><a class="header" href="#pluginregistrynamenvimrccondition"><code>pluginRegistry.&lt;name&gt;.nvimrc.condition</code></a></h3>
728-
<div class="option_description">
729-
<p>A VimL expression that will be evaluated to determine whether or not to execute
730-
the vim-plug 'Plug' command for this plugin (which will typically load the
731-
plugin, or configure it to be lazily loaded).</p>
732-
<p>Leave null in order to unconditionally always run the 'Plug' command for this
733-
plugin.</p>
734-
</div>
735-
<div class="option_properties">
736-
<ul>
737-
<li>
738-
<p><em>Type:</em> null or string</p>
739-
</li>
740-
<li>
741-
<p><em>Default:</em> <code>null</code></p>
742-
</li>
743-
</ul>
744-
</div>
745-
</div>
746-
<div class="option">
747-
<h3 id="pluginregistrynamenvimrcearly"><a class="header" href="#pluginregistrynamenvimrcearly"><code>pluginRegistry.&lt;name&gt;.nvimrc.early</code></a></h3>
748+
<h3 id="pluginregistrynameon_cmd"><a class="header" href="#pluginregistrynameon_cmd"><code>pluginRegistry.&lt;name&gt;.on_cmd</code></a></h3>
748749
<div class="option_description">
749-
<p>Extra lines of <code>init.vim</code> configuration associated with this plugin, that need
750-
to be as early as possible in the file.</p>
751-
<p>Leave null if no such extra configuration is required.</p>
752-
</div>
753-
<div class="option_properties">
754-
<ul>
755-
<li>
756-
<p><em>Type:</em> null or strings concatenated with &quot;\n&quot;</p>
757-
</li>
758-
<li>
759-
<p><em>Default:</em> <code>null</code></p>
760-
</li>
761-
</ul>
762-
</div>
763-
</div>
764-
<div class="option">
765-
<h3 id="pluginregistrynamenvimrcpostplugin"><a class="header" href="#pluginregistrynamenvimrcpostplugin"><code>pluginRegistry.&lt;name&gt;.nvimrc.postPlugin</code></a></h3>
766-
<div class="option_description">
767-
<p>Extra lines of <code>init.vim</code> configuration associated with this plugin, that need
768-
to be executed after the plugin loading.</p>
769-
<p>Leave null if no such extra configuration is required.</p>
770-
</div>
771-
<div class="option_properties">
772-
<ul>
773-
<li>
774-
<p><em>Type:</em> null or strings concatenated with &quot;\n&quot;</p>
775-
</li>
776-
<li>
777-
<p><em>Default:</em> <code>null</code></p>
778-
</li>
779-
</ul>
780-
</div>
781-
</div>
782-
<div class="option">
783-
<h3 id="pluginregistrynamenvimrcpreplugin"><a class="header" href="#pluginregistrynamenvimrcpreplugin"><code>pluginRegistry.&lt;name&gt;.nvimrc.prePlugin</code></a></h3>
784-
<div class="option_description">
785-
<p>Extra lines of <code>init.vim</code> configuration associated with this plugin, that need
786-
to be executed before the plugin loading.</p>
787-
<p>Leave null if no such extra configuration is required.</p>
750+
<p>One or more commands that should trigger on-demand loading of this plugin.</p>
751+
<p>Can be specified with either a single string or list of strings.</p>
788752
</div>
789753
<div class="option_properties">
790754
<ul>
791755
<li>
792-
<p><em>Type:</em> null or strings concatenated with &quot;\n&quot;</p>
756+
<p><em>Type:</em> string or list of strings</p>
793757
</li>
794758
<li>
795-
<p><em>Default:</em> <code>null</code></p>
759+
<p><em>Default:</em> <code>{}</code></p>
796760
</li>
797761
</ul>
798762
</div>
799763
</div>
800764
<div class="option">
801-
<h3 id="pluginregistrynameon"><a class="header" href="#pluginregistrynameon"><code>pluginRegistry.&lt;name&gt;.on</code></a></h3>
765+
<h3 id="pluginregistrynameon_map"><a class="header" href="#pluginregistrynameon_map"><code>pluginRegistry.&lt;name&gt;.on_map</code></a></h3>
802766
<div class="option_description">
803-
<p>One or more command or &lt;Plug&gt;-mappings that should trigger on-demand loading
804-
of this plugin.</p>
767+
<p>One or more &lt;Plug&gt;-mappings that should trigger on-demand loading of this
768+
plugin.</p>
805769
<p>Can be specified with either a single string or list of strings.</p>
806770
</div>
807771
<div class="option_properties">
@@ -946,40 +910,6 @@ <h3 id="pluginregistrynametag"><a class="header" href="#pluginregistrynametag"><
946910
</div>
947911
</div>
948912
<div class="option">
949-
<h3 id="postpluginconfig"><a class="header" href="#postpluginconfig"><code>postPluginConfig</code></a></h3>
950-
<div class="option_description">
951-
<p>Extra lines of <code>init.vim</code> configuration that need to be executed after the
952-
plugin loading.</p>
953-
</div>
954-
<div class="option_properties">
955-
<ul>
956-
<li>
957-
<p><em>Type:</em> strings concatenated with &quot;\n&quot;</p>
958-
</li>
959-
<li>
960-
<p><em>Default:</em> <code>&quot;&quot;</code></p>
961-
</li>
962-
</ul>
963-
</div>
964-
</div>
965-
<div class="option">
966-
<h3 id="prepluginconfig"><a class="header" href="#prepluginconfig"><code>prePluginConfig</code></a></h3>
967-
<div class="option_description">
968-
<p>Extra lines of <code>init.vim</code> configuration that need to be executed before the
969-
plugin loading.</p>
970-
</div>
971-
<div class="option_properties">
972-
<ul>
973-
<li>
974-
<p><em>Type:</em> strings concatenated with &quot;\n&quot;</p>
975-
</li>
976-
<li>
977-
<p><em>Default:</em> <code>&quot;&quot;</code></p>
978-
</li>
979-
</ul>
980-
</div>
981-
</div>
982-
<div class="option">
983913
<h3 id="sourcepins"><a class="header" href="#sourcepins"><code>sourcePins</code></a></h3>
984914
<div class="option_description">
985915
<p>Attribute set of source pins for vim plugins. Attribute names should map

0 commit comments

Comments
 (0)