On 09-Feb-2011 12:14, Milan Vancura wrote:
>> Here are some rules and guidelines from my personal "Vim scripting guide":
> ...snip
>> -- regards, ingo
> 
> Hi Ingo.
> 
> Thank you for a very precise description. I must say there much of interesting
> even for ~15 years user of vim like me :-) However, it's quite hard to read,
> esp. as a FAQ entry. What about the following, wouldn't it be more readable 
> for
> beginners? Even I _know_ it is not the simplest or shortest solution for those
> who know all details and special characters:
> 
> -------------------------------------------------------------------------------
> Mapping in normal mode could be executed after Ctrl-O from insert mode as well
> but if there are more commands included in the mapping {rhs}, only the first
> one will be executed in normal mode and the rest of {rhs} will be printed
> literally in insert mode. One of ways to workaround this problem is to make
> {rhs} be one command, via wrapping it to the function. For example:
> 
> function GetFontNameOfFirstChar()
>   normal 0
>   echo getfontname()
> endfunction
> 
> :nmap <F9> :call GetFontNameOfFirstChar()<CR>
> 
> For more solutions of this problem look <a href="Ingo's mail">here</a>.
> -------------------------------------------------------------------------------

Hi Milan,

On the one hand I fully agree that this entry is too detailed; I wrote it as my
personal notes in case I would encounter this problem again in the far future,
and I wanted to have all the options at hand.

Your suggested entry perfectly captures the essence of the problem and a
possible solution. I am not sure whether an added function is always the best
way to solve the problem, though. It really depends on the kind of mappings that
one wants to combine.

I guess I'll leave it to Christian, the FAQ maintainer, to decide whether he
wants to keep the full details or replace it with your shorter suggestion and
the link to this archived entry on vim_dev.

-- regards, ingo

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui