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

Re: Question about if in command-lines

Expand Messages
  • Benji Fisher
    ... [snip] ... There does not seem to be a convenient help tag for it, but ... /-bar takes you to the right part of the docs. Try (untested) ... HTH
    Message 1 of 3 , Jun 2, 2002
    • 0 Attachment
      "HALIM,SALMAN (HP-NewJersey,ex2)" wrote:
      >
      > Hi,
      >
      > I have what is hopefully a simple question; given this function:
      >
      [snip]
      > com! Togglenumbering call ToggleNumbering ()
      >
      > Wondering why the following command reacts the way it does:
      >
      > :if ( &ft == 'java' ) | Togglenumbering | endif
      >
      > This doesn't seem to take the 'endif' and instead displays a :
      > command-line (indented) as if it's still inside the if block (I have to
      > type endif manually to get out).
      >
      > However, the above syntax works for simpler commands:
      >
      > :if ( &ft == 'java' ) | set nu | endif

      There does not seem to be a convenient help tag for it, but

      :help :command
      /-bar

      takes you to the right part of the docs. Try (untested)

      :com! -bar Togglenumbering call ToggleNumbering ()

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