On Mon, Nov 23, 2009 at 05:30:55AM EST, Jürgen Krämer wrote:

[..]

> > nnoremap <Space> i<Space><Esc>             " what this does..
> 
> it's best to never write a comment after a mapping -- just put it in a
> separate line above or below.

That habit of mine is going to be difficult to break.

> Apart from the additional movement this line also results in an error,
> because the space after the quote character is not a valid register
> name. You should have heard a beep or seen Vim's window flash.

Beeping and visual bells have been disabled for so long here that I
don't even remember how I did it. And all the time I had a feeling  it
would come back and bite me at some point. 

> If you really want to put the comment on the same line insert a bar
> immediately after the last character of you mapping, i.e.,
> 
>   nnoremap <Space> i<Space><Esc>|            " what this does..

Perfect. Although, now I don't have enough space left on the line to
make a note of what that bar is for..  :-)

> The bar ends the nnoremap and starts a new command -- which solely
> consists of a single comment.

I was a bit suprised to see that the :map command displayed the comment
from my .vimrc but I failed to put two and two together: since the
output of :map showed my comment, I should have suspected that vim
considered it part of the mapping, not a comment.

Thanks,

CJ






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

Reply via email to