Schif Schaf <[email protected]> [09-09-06 07:25]:
> 
> I often need to type out a line that looks something like the
> following:
> 
>     foo(['abc'])
> 
> To do so, I might literally type the following:
> 
>   * foo
>   * ()
>   * <Left-Arrow>
>   * []
>   * <Left-Arrow>
>   * ''
>   * <Left-Arrow>
>   * abc
> 
> This is a habit I got into a long time ago: always type both the
> opening and closing of something before typing what goes inside it.
> This has been quite helpful for me when writing deeply nested lists of
> lists, hashes of hashes, and so on.
> 
> Anyway, after typing that line, my cursor is left at the end of the
> "abc". To finish the line and start the next one, I'm seem to be stuck
> doing "<Esc> A <Return>" all the time.
> 
> It doesn't seem like Vim should require me to do so much work. What's
> the most optimized way to use Vim to type that line above?
> 
> Finally, since this is probably on-topic for this post, does Vim
> support electric brackets? That would save me a number of visits to my
> left arrow key, though still wouldn't get me out of that "<Esc> A"
> required at the end.
> 
> Thanks.
> 
> 
Hi,

 hmmm...
 I know what you want to achieve by typing text in its syntactically
 order instead of the order it is read.
 But this implies, that you have to go back to finally get
 it into the correct sequential order instead of
 foo()[]''abc

 One idea would be to put a litle Emacs into your vim and
 imap <ctrl-E> to what ESC-A do for you and imap
 <ctrl-A> to what ESC-I do.
 This way you dont need to leave input mode and ctrl-a/ctrl-e are
 better to reach than this escape a keyboard limits.

 The other idea would be to get used to remember some amount
 of syntax levels and type text in the order it would be
 read. It is much easier.... ;)

 HTH
 Have a nice sunday,
 mcc

-- 
Please don't send me any Word- or Powerpoint-Attachments
unless it's absolutely neccessary. - Send simply Text.
See http://www.gnu.org/philosophy/no-word-attachments.html
In a world without fences and walls nobody needs gates and windows.






--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to