Wednesday, July 21, 2010

Howto execute VIM-commands in editing mode, needed for prototype

Hello,

To show a UI-concept I would reconfigure vim. The plan is that the user
writes text. If the user type !command (where command is an editor
command defined somewhere) the command should be executed directly. The
idea is not to switch explicitely between command layer and editing
layer (as with the esc-key in vim)

An example, the user wants to write "Hello World!" and will print the
text then. Because we use ! as command indicator, the !! will escape
"!". In the editor will be viewable this:

Hello World
^

Hello World!!!pr
^ The user escaped "!" and starts writing command

Hello World!!!print
^ The command "print" ends and will be executed

Hello World!
^The cursor stands here now


How could I configure this behaviour in vim? I think imap is my friend?
Could you point me to an example?

If possible it would be also usefull, if a command-indicator ! is
detected, that an intellisense-menu will be popped showing available
commands? Where should I start to program this?

Thanks in advance,

Bye Andreas
--
Andreas Romeyke
- Abteilung Blindenschrift -
Deutsche Zentralbücherei für Blinde zu Leipzig (DZB)
Gustav-Adolf-Straße 7, 04105 Leipzig
Tel: +49 341 7113-..., Fax: +49 341 7113-125
Internet: www.dzb.de
E-Mail: andreas.romeyke@dzb.de

--
--
Diese e-mail wurde auf Spam und Viren mit Astaro Security Gateway geprueft.

No comments:

Post a Comment