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

Re: Writing a function

Expand Messages
  • Benji Fisher
    ... HTH --Benji Fisher
    Message 1 of 2 , Jun 3, 2003
    • 0 Attachment
      Bernard El-Hagin wrote:
      >
      > Hi,
      >
      > I'd like to write a function which accepts a numerical argument and
      > then visually marks as many words as the argument. How can I pass the
      > argument to the function as I would to the w motion for example? Is it
      > possible to write a function in such a way that I can type 5 then some
      > key mapped to that function and have the 5 be considered as the
      > function's argument?

      :help v:count
      :help v:prevcount

      Quick example (not involving a function):

      :nmap <F5> :<C-U>echo v:count<CR>

      HTH --Benji Fisher
    Your message has been successfully submitted and would be delivered to recipients shortly.