1- *libmodal.txt* Create modes for Neovim
1+ *libmodal.txt* Create modes for Neovim
22*libmodal*
33*nvim-libmodal*
44
5- =============================================================================
6- 0. Table of Contents *libmodal-toc*
5+ ================================================================================
6+ 0. Table of Contents *libmodal-toc*
77
881. About ................ | libmodal-about |
992. Usage ................ | libmodal-usage |
15158. Changelog ............ | libmodal-changelog |
16169. Credits .............. | libmodal-credits |
1717
18- ==============================================================================
19- 1. About *libmodal-about*
18+ ================================================================================
19+ 1. About *libmodal-about*
2020
2121| nvim-libmodal | :
2222- Author, Iron-E @ https://github.com/Iron-E & https://gitlab.com/Iron_E
@@ -33,8 +33,8 @@ modes is also creator-defined, and is outlined in |libmodal-usage|.
3333
3434See: | vim-modes |
3535
36- ------------------------------------------------------------------------------
37- USE CASE *libmodal-use-case-example*
36+ --------------------------------------------------------------------------------
37+ USE CASE *libmodal-use-case-example*
3838
3939As an | init.vim | configuration grows, it becomes harder to create keybindings
4040that alphabetically represent the action that they perform. To get around
@@ -69,8 +69,8 @@ buffers persevere).
6969
7070See: | libmodal-usage |
7171
72- ==============================================================================
73- 2. Usage *libmodal-usage*
72+ ================================================================================
73+ 2. Usage *libmodal-usage*
7474
7575The | libmodal | interface is designed completely in | Lua | . It is compatable
7676with Vimscript, and so one may either:
@@ -92,8 +92,8 @@ Note: Examples for all topics covered here can be found in the "examples"
9292See: | api | , | lua-api | , https://github.com/Iron-E/nvim-tabmode ,
9393 https://gist.github.com/Iron-E/f36116e8862ea03fd195e4e0a48cb05d
9494
95- ------------------------------------------------------------------------------
96- FUNCTIONS *libmodal-usage-functions*
95+ --------------------------------------------------------------------------------
96+ FUNCTIONS *libmodal-usage-functions*
9797
9898 *libmodal-mode* *libmodal#Enter()* *libmodal.mode.enter()*
9999`libmodal.mode ` .enter({name} , {instruction} [, {supressExit} ])
@@ -127,7 +127,8 @@ FUNCTIONS *libmodal-usage-functions*
127127 local modeInstruction = {
128128 ['zf'] = 'split',
129129 ['zfo'] = 'vsplit',
130- ['zfc'] = 'tabnew'
130+ -- You can also use lua functions
131+ ['zfc'] = function() return 'tabnew' end
131132 }
132133
133134 " VIMSCRIPT
@@ -286,8 +287,8 @@ FUNCTIONS *libmodal-usage-functions*
286287 | libmodal-examples-prompt | For examples of this function.
287288
288289
289- ==============================================================================
290- 3. Examples *libmodal-examples*
290+ ================================================================================
291+ 3. Examples *libmodal-examples*
291292
292293Below are examples written in | Lua | to help show how specific features of
293294| libmodal | may be implemented. In each example, the name of the mode is
@@ -300,8 +301,8 @@ all be tested using the |luafile| |command|.
300301
301302See: | libmodal-usage | , | libmodal-use-case | , | lua-require-example | .
302303
303- ------------------------------------------------------------------------------
304- MODES *libmodal-examples-modes*
304+ --------------------------------------------------------------------------------
305+ MODES *libmodal-examples-modes*
305306
306307Using a callback `function ` : >
307308 local api = vim.api
@@ -356,7 +357,7 @@ Using a |key-mapping| `table`: >
356357<
357358
358359Exit Supression ~
359- *libmodal-examples-supress-exit*
360+ *libmodal-examples-supress-exit*
360361
361362Using a callback `function ` : >
362363 local libmodal = require('libmodal')
@@ -399,7 +400,7 @@ Using a |key-mapping| `table`: >
399400<
400401
401402Submodes ~
402- *libmodal-examples-submodes*
403+ *libmodal-examples-submodes*
403404
404405Using a callback `function ` : >
405406 local libmodal = require('libmodal')
@@ -457,8 +458,8 @@ Using a |key-mapping| `table`: >
457458 fooMode()
458459<
459460
460- ------------------------------------------------------------------------------
461- LAYERS *libmodal-examples-layers*
461+ --------------------------------------------------------------------------------
462+ LAYERS *libmodal-examples-layers*
462463>
463464 local libmodal = require('libmodal')
464465
@@ -481,8 +482,8 @@ LAYERS *libmodal-examples-layers*
481482 vim.schedule_wrap(exitFunc)
482483 )
483484<
484- ------------------------------------------------------------------------------
485- PROMPTS *libmodal-examples-prompts*
485+ --------------------------------------------------------------------------------
486+ PROMPTS *libmodal-examples-prompts*
486487
487488Using a callback `function ` : >
488489 local libmodal = require('libmodal')
@@ -524,14 +525,14 @@ Using a |command| `table`: >
524525 libmodal.prompt.enter('BAR', commands)
525526<
526527
527- ==============================================================================
528- 4. Configuration *libmodal-configuration*
528+ ================================================================================
529+ 4. Configuration *libmodal-configuration*
529530
530531The following specifies what settings may be used to configure
531532| libmodal-mode | s and | libmodal-prompt | s.
532533
533- ------------------------------------------------------------------------------
534- HIGHLIGHT GROUPS *libmodal-highlight-groups*
534+ --------------------------------------------------------------------------------
535+ HIGHLIGHT GROUPS *libmodal-highlight-groups*
535536
536537
537538The following | highlight-groups | can be | config | ured to change a mode's | color | s:
@@ -548,8 +549,8 @@ Note: `LibmodalStar`'s name — while not indicative of its use — is used for
548549 when Neovim 0.5 launches that will introduce interoperaability between
549550 the two.
550551
551- ------------------------------------------------------------------------------
552- TIMEOUTS *libmodal-timeouts* *g:libmodalTimeouts*
552+ --------------------------------------------------------------------------------
553+ TIMEOUTS *libmodal-timeouts* *g:libmodalTimeouts*
553554
554555When `libmodal.mode .enter ()` 's {instruction} argument is a `table` , mode
555556creators may also enable the use of Vim's built-in 'timeout' feature.
@@ -631,8 +632,8 @@ then reset it upon exit. Example:
631632Mode creators who use `function ` {instruction} s may define timeouts manually
632633using | timers | , which is how | libmodal | implements them internally.
633634
634- ==============================================================================
635- 5. License *libmodal-license*
635+ ================================================================================
636+ 5. License *libmodal-license*
636637
637638`nvim- libmodal` – Create new "modes" for Neovim.
638639Copyright © 2020 Iron-E
@@ -650,66 +651,66 @@ GNU General Public License for more details.
650651You should have received a copy of the GNU General Public License
651652along with this program. If not, see <http://www.gnu.org/licenses/ >.
652653
653- ==============================================================================
654- 6. Bugs *libmodal-bugs*
654+ ================================================================================
655+ 6. Bugs *libmodal-bugs*
655656
656657* `libmodal#Enter ()` does not work when {instruction} is a | funcref | .
657658 * See | E5004 | .
658659* `libmodal#Prompt ()` does not work when {instruction} is a | funcref | .
659660 * See | E5004 | .
660661
661- ==============================================================================
662- 7. Contributing *libmodal-contributing*
662+ ================================================================================
663+ 7. Contributing *libmodal-contributing*
663664
664665The following describes what should be done if an individual wishes to
665666contribute something to the `Iron- E/nvim- libmodal` repository.
666667
667- ------------------------------------------------------------------------------
668- CODE *libmodal-contributing-code*
668+ --------------------------------------------------------------------------------
669+ CODE *libmodal-contributing-code*
669670
670- Bugfixes ~
671+ Bugfixes ~
671672
672- If you discover a bug and believe you know the solution to fixing it, then
673- submit a bug report and state that you are working on a fix (and what that
674- fix might be), and what general timeframe the fix may be completed in
675- (months, weeks, days, etc.).
673+ If you discover a bug and believe you know the solution to fixing it, then
674+ submit a bug report and state that you are working on a fix (and what that
675+ fix might be), and what general timeframe the fix may be completed in
676+ (months, weeks, days, etc.).
676677
677- When the fix is complete, submit a PR that references the issue you
678- submitted.
678+ When the fix is complete, submit a PR that references the issue you
679+ submitted.
679680
680- Features ~
681+ Features ~
681682
682- If there is a feature you would like to be a part of | libmodal | , the best
683- thing you can do is submit a feature request, and then state that you are
684- working on a pull request (PR) so others don't attempt to do the same work
685- at the same time.
683+ If there is a feature you would like to be a part of | libmodal | , the best
684+ thing you can do is submit a feature request, and then state that you are
685+ working on a pull request (PR) so others don't attempt to do the same work
686+ at the same time.
686687
687- When you believe your feature is complete, write some examples for it in
688- the `examples/lua ` folder, and add them to | libmodal-examples | as
689- appropriate.
688+ When you believe your feature is complete, write some examples for it in
689+ the `examples/lua ` folder, and add them to | libmodal-examples | as
690+ appropriate.
690691
691- Assure that all existing | libmodal-examples | continue to work with your
692- feature, unless a breaking change was discussed on the feature request.
693- If you need help getting them to pass, you can ask for help on the PR.
692+ Assure that all existing | libmodal-examples | continue to work with your
693+ feature, unless a breaking change was discussed on the feature request.
694+ If you need help getting them to pass, you can ask for help on the PR.
694695
695- Reference the issue you submitted on the PR so that the two show up
696- together when looking back at the history.
696+ Reference the issue you submitted on the PR so that the two show up
697+ together when looking back at the history.
697698
698- Contributing documentation is not necessary but appreciated, since the
699- person who knows the most about the feature being implemented is most
700- likely the one implementing it.
699+ Contributing documentation is not necessary but appreciated, since the
700+ person who knows the most about the feature being implemented is most
701+ likely the one implementing it.
701702
702- ------------------------------------------------------------------------------
703- DOCUMENTATION *libmodal-contributing-documentation*
703+ --------------------------------------------------------------------------------
704+ DOCUMENTATION *libmodal-contributing-documentation*
704705
705706If there is a problem with the documentation, or you see an area where it
706707could be improved, don't hesitate to submit an issue and a PR. At the very
707708least it will exist in history if such an issue comes up again, and likely it
708709will serve to help yourself and others with more clear and concise wording, or
709710with more helpful and practical examples.
710711
711- ------------------------------------------------------------------------------
712- ISSUES *libmodal-contributing-issues*
712+ --------------------------------------------------------------------------------
713+ ISSUES *libmodal-contributing-issues*
713714
714715Issues are greatly welcomed on the GitHub repository, whether they are bug
715716reports, feature requests, documentation improvements, or misunderstandings:
@@ -724,8 +725,18 @@ When submitting an issue, please describe the following:
7247254. Expected behavior (if applicable).
7257265. Attached media (screenshots, logs, etc.) (if applicable).
726727
727- ==============================================================================
728- 8. Changelog *libmodal-changelog*
728+ ================================================================================
729+ 8. Changelog *libmodal-changelog*
730+
731+ 0.8.0 ~
732+
733+ Additions: ~
734+ * Ability to use | lua | `function ` s as values in a | libmodal-mode |
735+ {instruction} `table` .
736+ * Ability to use | lua | `function ` s as values in a | libmodal-prompt |
737+ {instruction} `table` .
738+ * Add | libmodal-mode | and | libmodal-prompt | kill functions
739+ (| libmodal-lua-utils-exit | ).
729740
7307410.7.0 ~
731742
@@ -837,8 +848,8 @@ When submitting an issue, please describe the following:
8378480.3.1 ~
838849
839850 Fixes: ~
840- * Fix bug where everytime `api.nvim_lecho ()` was called, its {hlTables} would
841- infinitely grow with placeholder "None" entries.
851+ * Fix bug where everytime `api.nvim_lecho ()` was called, its {hlTables}
852+ would infinitely grow with placeholder "None" entries.
842853
8438540.3.0 ~
844855
@@ -866,8 +877,8 @@ When submitting an issue, please describe the following:
866877 Additions: ~
867878 * | libmodal-mode | implementation from | vim-libmodal | .
868879
869- ==============================================================================
870- 9. Credits *libmodal-credits*
880+ ================================================================================
881+ 9. Credits *libmodal-credits*
871882
872883Credit Reason
873884--------------------- ----------------------------------
@@ -883,5 +894,5 @@ u/oryiesis Inspiration.
883894www.lua-users.org | Lua | reference.
884895www.stackoverflow.com Vimscript and | Lua | reference.
885896
886- ==============================================================================
887- vim:tw=78 :ts=4:ft=help:norl:
897+ ================================================================================
898+ vim:tw=80 :ts=4:ft=help:norl:
0 commit comments