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

34921Re: Mapping with count

Expand Messages
  • Benji Fisher
    Dec 4, 2002
    • 0 Attachment
      kbosau@... wrote:
      > Hi,
      >
      > I'd like to create a normal mode mapping one
      > can control by a number that has to be typed
      > in prior to hitting the mapped key...
      >
      > function! f()
      > Do something dependent of the
      > value of the number that has
      > been typed prior to hitting 'z'
      > endfunction
      >
      > nmap z :call f()<Cr>
      >
      > for instance should define a normal mode
      > command '34z'.
      >
      > How can I achieve this?

      Silly me! This can already be done:

      fun! F()
      " Remember to start the function name with a capital!
      echo "count =" v:count
      \ ", count1 =" v:count1
      \ ", prevcount =" v:prevcount
      endfun

      HTH --Benji Fisher
    • Show all 9 messages in this topic