linda.s Sent: Saturday, April 08, 2006 7:53 PM
>On 4/8/06, Suresh Govindachar <[EMAIL PROTECTED]> wrote:
>>
>> linda.s Sent April 08, 2006 7:13 PM
>>
>> > [Question concerned use of arrow keys to
>> > move vertically when lines are wrapped]
>>
>> See help gj and help gk
>>
>> In another post, you asked about examples of map and imap;
>> and in yet another post, I gave an example of an imap.
>> Here are examples of nmap:
>>
>> noremap <down> gj
>> noremap <up> gk
>>
>> Since I use the alphabet keys (rather than arrow keys) to move,
>> I have the following maps in my _vimrc:
>>
>> nnoremap j gj
>> nnoremap gj j
>> nnoremap k gk
>> nnoremap gk k
>>
>> --Suresh
>>
>>
>
> Thanks. But what is the difference between "map" and "nnoremap"?
> I tested it and they are the same. If so, why use "nnoremap"?
no-remap means interpret the rhs as raw keys, and not as mapped
keys. Try the following:
First do:
nmap gj j
Then do:
nmap <down> gj
now, since gj on rhs is j, <down> acts as j.
> Also, I wonder how I can use the help file?
Using vim's help can be tricky.
After typing :help <part of some stuff>, hit <ctrl-d>
Put the following in your vimrc and hit <tab> while in
the command line
set wildmenu
set wildmode=list:longest,full
> I mean though I know "j" means go down one space , i can not
> image "gj" can solve my question.
I found out about gj on this list. However, doing :help j and
reading down a few lines shows gj.
To know how to "restore" a map or undo a map, see
:help :map
and read a few lines below (unmap, nunmap etc.).
--Suresh