On 05/13/12 10:58, Dotan Cohen wrote:
> I have a few of these wonderful helpers:
> inoremap foreach<Return> foreach (<Space><Space>)<Return>{<Return><R
>  eturn>}<Esc>3kA<Left><Left>
> 
> I know that there is a snippets plugin, but I like this roll-my-own
> solution for a number of reasons (one of which is to learn Vim).
> However, one problem that I have is that the text f-o-r-e-a-c-h is not
> shown until I get to the end of the map. Is there any way to configure
> VIM to show the text normally, until it decides that there will be a
> replacement? This is driving me crazy.

You might try it with an abbreviation instead:

:iab foreach foreach(<space>)<cr>{<cr><cr>}<up><up><up><end><left><left>

which allows you to see it as you type it (also expands on <space>
which I prefer over <enter>).

Setting 'showcmd' doesn't quite do it (it shows each letter
in-place), but it's not a bad followup solution.

-tim


-- 
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

Reply via email to