Loading ...
Sorry, an error occurred while loading the content.

Re: Vmap help

Expand Messages
  • Jürgen Krämer
    Hi, ... you need to restore the visual selection at the beginning of the normal command: vmap : exe normal gv . winheight(0) .
    Message 1 of 2 , Dec 2, 2003
    • 0 Attachment
      Hi,

      David Fishburn wrote:
      >
      > I have the following in my vimrc:
      > " Courtesy of Jürgen Krämer
      > " When you page up and down, your cursor will finish on the same
      > " line it started on
      > nmap <silent> <PageDown> :exe 'normal ' . winheight(0) . 'j'<cr>
      > nmap <silent> <PageUp> :exe 'normal ' . winheight(0) . 'k'<cr>
      > imap <silent> <PageDown> <C-O>:exe 'normal ' . winheight(0) . 'j'<cr>
      > imap <silent> <PageUp> <C-O>:exe 'normal ' . winheight(0) . 'k'<cr>
      >
      > I am trying to add the same for visual mode, everything I have tried
      > does not work.
      > I am not sure what I am doing wrong:
      > vmap <silent> <PageDown> :<C-U>exe '' . winheight(0) . 'j'<cr>
      > vmap <silent> <PageUp> :<C-U>exe 'normal ' . winheight(0) .
      > 'k'<cr>

      you need to restore the visual selection at the beginning of the
      normal command:

      vmap <silent> <PageDown> :<C-U>exe 'normal gv' . winheight(0) . 'j'<cr>
      vmap <silent> <PageUp> :<C-U>exe 'normal gv' . winheight(0) . 'k'<cr>

      Regards,
      Jürgen

      --
      Jürgen Krämer Softwareentwicklung
      Habel GmbH mailto:jkr@...
      Hinteres Öschle 2 Tel: (0 74 61) 93 53 15
      78604 Rietheim-Weilheim Fax: (0 74 61) 93 53 99
    Your message has been successfully submitted and would be delivered to recipients shortly.