On 04/12/08 01:44, Charlie Kester wrote:
> On Wed 03 Dec 2008 at 16:13:24 PST Tony Mechelynck wrote:
>> It depends what you call "more elegant". Personally I don't like<CR>  in
>> the middle of a mapping.
>
> Can you expand on that?  What's wrong with<CR>  in a mapping?
>
> I sense there's a subtlety here that might help me (and others)
> better understand how to use vim effectively.

I don't think it's "wrong", it's just that I "don't like" it. I feel 
that avoiding it makes the mapping more understandable. In the case of 
ex-commands, you can use the bar character | (or <Bar> in a mapping) to 
concatenate several ex-commands on one line, so that's one possibility 
(except for the few commands which see the bar as part of their 
argument, see ":help :bar", but in that case exe-wrapping can be used); 
if the {rhs} is very complex with many commands, it's usually more 
readable to define a function (with one ex-command per line, or 
":normal" to use a Normal command), and then call the function in the 
{rhs} of the mapping.

<CR> at the end of a mapping is perfectly OK, e.g. to terminate an 
ex-command (or a string of <Bar>-separated ex-commands).


Best regards,
Tony.
-- 
"My particular problem is with registry entries, which seem to just 
accumulate
like plastic coffee cups..."           -- Paul Moore

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

Reply via email to