Georg Dahn wrote:
Hi!

--- "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:
map     <Down>  gj
imap    <Down>  <C-O>gj
map     <Up>    gk
imap    <Up>    <C-O>gk

IMHO these mappings are a better choice:

noremap <Down> gj
noremap <Up> gk
inoremap <expr> <Down> pumvisible() ? "\<lt>Down>" : "\<lt>C-O>gj"
inoremap <expr> <Up> pumvisible() ? "\<lt>Up>" : "\<lt>C-O>gk"

These two are V7 only, so:

if exists("*pumvisible")
        inoremap <expr> <Down> pumvisible() ? "\<lt>Down" : "\<lt>C-O>gj"
        inoremap <expr> <Up>   pumvisible() ? "\<lt>Up"   : "\<lt>C-O>gj"
else
        inoremap <Down> <C-O>gj
        inoremap <Up>   <C-O>gk
endif


With this the cursor keys still work with the popup menu.

In addition I define the following mappings:

noremap <S-Down> gj
noremap <S-Up> gk
inoremap <S-Down> <C-O>gh<C-O>gj
inoremap <S-Up> <C-O>gh<C-O>gk
nnoremap <S-Down> gh<C-O>gj
nnoremap <S-Up> gh<C-O>gk

With these mappings invoking the selection mode works more consistently with
above mappings.

No problem for me, and no need to change them from file to file.

I fully agree with this.

Best wishes,
Georg


Best regards,
Tony.

Reply via email to