Saluton Ben :)

On Tue 19 May 2009 12:30 +0200, Ben Fritz <[email protected]> dixit:
> On May 19, 4:35 am, Raúl Núñez de Arenas Coronado <[email protected]>
> wrote:
>>
>> I was wondering if a version of "o/O" exists that instead of adding a
>> new line below/above the current one and going into insert mode just
>> breaks the current line and goes into insert mode.
>
> I don't think there is. i<CR> isn't all that many keystrokes, though
> :-).

The problem is not the number of keystrokes, but the fact that when I
want to break a line I hit Enter without thinking, which just goes to
the line below, and then I remember "I'm in normal mode, I have to use
'o'", hit it without thinking and the I have to hit "<Esc>u", move to
the proper place and hit "i<CR>". Usually I remember to use "i<CR>", but
more often than not I do the above: Enter, damn, o, damn, etc...

Entirely my fault.

>> Moreover, in my map I want to do something like this (which doesn't
>> work):
>>
>> nnoremap <buffer><Leader>o :while getline(".")[col(".") - 1] ==
>> '>'\|normal l\|endwhile<CR>
>
> For one thing, see :help :bar. :normal is a command that takes a | as
> an argument, so you need to use :execute "normal l" in order to change
> it.
>
> There may be other problems too but that's the most obvious.

Oh, my... The worst part is that I already knew about this! I knew that
I had to escape the bar for "map", and I checked ":help :bar" to make
sure "while" didn't see the bar as part of its command. But then I
forget that "normal" takes the bar as an argument and thought the
problem was with "while", not with "normal".

Thanks a lot for showing me my stupidity XDDDD. Really, thanks, you
saved me a big headache :)

-- 
Raúl "DervishD" Núñez de Arenas Coronado
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!

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

Reply via email to