On Tuesday, November 5, 2013 12:08:03 PM UTC-6, Edward K. Ream wrote:

While waiting for Leo 4.11 final, I thought I'd post some thoughts about 
> new kinds of abbreviations...
>
2. Vim-simulation using minibuffer abbreviations.
>

doc/leoNotes.txt (accessible from leoPy.leo) now contains the tree: "vim 
reference card".

I spent several hours organizing and generally grokking the info there.  
Here are some thoughts:

1. Vim commands are organized in relatively simple patterns, namely

         one-or-two-keys
{visual} one-or-two-keys
{count}  one-or-two-keys
{count}  key {motion}
{count}  key {char}

I've studied the vim main line: there are a surprising amount of hacks 
needed to make all *seem* smooth.  Exactly the same thing applies to Leo's 
k.masterKeyHandler and its helpers.  In other words, nothing too 
extraordinary needs to happen.

It would be *relatively* easy to add similar capabilities to Leo.  The 
visual and count prefixes would be handled in k.getArg, or somewhere 
similar.  More logging would be needed for the dot command.  Etc.

2. The key to progress, imo, is *easy* experimentation with alternatives.  
That's why I am excited about minibuffer abbreviations.  They should be 
easy to do, and they may open a wide range of possibilities.

Experimentation is vital because there is *no way* for Leo's commands to 
match vim's exactly.  Many vim commands make little sense in Leo.  Otoh, 
new commands will be needed to handle Leo's richer environment, especially 
the outline pane.

3. A review of the reference card revealed interesting features and 
commands.

Smart search: use case-sensitive search only if the find pattern contains 
at least one uppercase letter.  Clever.  Leo should have this as an option.

The following vim commands caught my eye:

The dot command.  This is the big one.  Leo must have this.
jump/tag lists.
registers (holding built-up commands)
displaying errors

:r [file] insert the contents of [file] below the cursor
:r! {command} insert the standard output of {command} below the cursor
:@<a-z> execute the contents of register <a-z> as an Ex command
:@@ repeat previous :@<a-z>
:!{command} execute {command} with a shell
:make [args] start make, read errors, and jump to first error
:split  split window into two parts. (A command interface for Terry's 
Easter Egg).

Summary

The first step will be experimentation based on minibuffer abbreviations.

The goal will be to put in place a framework for duplicating vim's 
important commands.  This will require new vim-oriented commands, and other 
core changes.

If the project succeeds, there will be no further need for the horribly 
complex @mode code.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to