On 09/12/08 05:17, juner wrote:
> Is there a way to make the arrow keys in vim/gvim act exactly like
> gedit or other typical windows editors? What I want are:
>
> 1. When I press the left key, the cursor will of course move left; but
> when it reach the beginning of a line, it stops, and it won't move to
> the above line. Sometimes this can be quite inconvenient. However,
> this problem can be partly solved by setting "set whichwrap
> +=<,>,h,l" . By "partly solved", I mean this only applies to wrapped
> lines; when the cursor reaches the beginning of a vim "true" line, it
> won't move any more.

Hm. In my gvim 7.2.68, when 'whichwrap' includes "h,l", hitting the h 
key repeatedly moves from the start of one line to the end of the 
previous one, but even when it includes "<,>", it doesn't when using 
<Left> (neither in Normal nor Insert modes). OTOH, with <Right> and > it 
works.

This looks like a bug to me. (Bram, what do you think?)

I checked that gvim correctly sees my left-arrow key: in Insert mode, 
Ctrl-K followed by left-arrow inserts <Left> into the buffer.

>
> 2. I always set vim to wrap lines automatically, which means a long
> line will appear several lines in the editor. When I press the
> "up"/"down" key, the cursor will move to the above or the below line.
> Here the word "line" means the vim "true" line, not the apparent lines
> shown on the screen. This is inconvenient to me. Even if I have set
> "set whichwrap+=<,>,h,l", the performance won't change.
>
> Is is there some settings or plugins to work this out? Thanks!

Here, I use the following

        map     <Up>    gk
        map     <Down>  gj
        imap    <Up>    <C-O>gk
        imap    <Down>  <C-O>gj

to have <Up> and <Down> move by screen lines in both Normal and Insert 
modes. In Normal mode, j and k still move by file lines.

See
        :help map-overview
        :help gj
        :help gk
        :help i_CTRL-O


Best regards,
Tony.
-- 
        "To whoever finds this note -
        I have been imprisoned by my father who wishes me to marry
        against my will.  Please please please please come and rescue me.
        I am in the tall tower of Swamp Castle."
    SIR LAUNCELOT's eyes light up with holy inspiration.
                  "Monty Python and the Holy Grail" PYTHON (MONTY) 
PICTURES LTD

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

Reply via email to