Monday, November 25, 2013

Studying the Structure of Vim's Commands

I'm interested in studying the structure of the command language of Vim. Several people have likened Vim's command structure to a formal language (http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-nouns-and-modifiers/) and I'd like to take a closer look at it as such.

One of the things I like to do is to construct a hierarchy of the commands in Vim. If a user enters 'c' in command mode, what are all of the possible choices for their next input character that would map to a valid command (like 'a', 'i', etc). Expanding on this notion a little, one could construct a sort of "two way" hierarchy to show all possible prefixes and suffixes to sub-string of commands, similar to how Scrabble moves are mapped out (http://en.wikipedia.org/wiki/GADDAG). This could be used in several tools, such as aiding new users to find ways to augment their existing knowledge of commands, or as a way to verify compatibility for systems seeking to emulate the Vim command structure.

In addition, a hierarchical structure could be analyzed to look for open sequences of commands for new plugins or remapping of commonly used commands, or in an attempt to redesign the command structure to make it more compact, i.e. fit into a shorter tree representation.

Has this been done before? Has there been much research done on the Vim command structure itself (not VimScript) as a language? Is there a map out there somewhere that shows every possible vim command (with reasonable limits, like not including '/searchForwhateverYouWant' and similar commands)? Could a script be written to analyze the Vim runtime for possible commands?

Any resources you could provide would be helpful!

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: