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

Lisp in vim

Expand Messages
  • OvErboRed
    For some reason, the indentation scheme in vim for lisp is not quite right. It doesn t indent lines starting with #. However, it is perfectly reasonable to
    Message 1 of 3 , May 1 11:14 PM
      For some reason, the indentation scheme in vim for lisp is not quite right.
      It doesn't indent lines starting with #. However, it is perfectly reasonable
      to refer to a function with #'function-name, and have this start a line. So,
      I commented out the line in lisp.vim saying:

      syn region lispCommentRegion start="#|" end="|#"
      contains=lispCommentRegion,@lispCommentGroup

      But then this means I can no longer comment out a region. Is there any way
      to fix this? Thanks in advance.
    • OvErboRed
      I didn t realize they were distinct. Anyway, I tried it again just to be sure, and changing the .vim file does in fact change the indentation. Is there a
      Message 2 of 3 , May 3 2:35 PM
        I didn't realize they were distinct. Anyway, I tried it again just to be
        sure, and changing the .vim file does in fact change the indentation. Is
        there a separate set of vim language indentation files I'm not aware of?

        -----Original Message-----
        From: Charles E. Campbell, Jr. [mailto:drchip@...]
        Sent: Monday, May 03, 2004 1:32 PM
        To: OvErboRed
        Subject: Re: Lisp in vim

        OvErboRed wrote:

        >For some reason, the indentation scheme in vim for lisp is not quite right.
        >It doesn't indent lines starting with #. However, it is perfectly
        reasonable
        >to refer to a function with #'function-name, and have this start a line.
        So,
        >I commented out the line in lisp.vim saying:
        >
        >syn region lispCommentRegion start="#|" end="|#"
        >contains=lispCommentRegion,@lispCommentGroup
        >
        >But then this means I can no longer comment out a region. Is there any way
        >to fix this? Thanks in advance.
        >
        >
        I'm confused -- are you asking about indenting or syntax highlighting?
        The "syn region..." stuff is syntax highlighting.

        Regards,
        Chip Campbell
      • OvErboRed
        In Lisp, the indentation for function calls works like this: (myfunction param1 param2 param3) However, you can also pass functions (foo in this case) as
        Message 3 of 3 , May 4 3:43 PM
          In Lisp, the indentation for function calls works like this:

          (myfunction param1
          param2
          param3)

          However, you can also pass functions (foo in this case) as arguments.

          (myfunction param1
          param2
          #'foo
          param3)

          But the lisp.vim file treats this as the beginning of a comment region. (I
          actually don't know what this is supposed to look like since I've never seen
          or used such comments.) So the above code turns out:

          (myfunction param1
          param2
          #'foo
          param3)

          I don't set any lisp-related options, everything just works when I open up a
          .lisp file. If you're able to fix this issue, that'd be great.

          -----Original Message-----
          From: Charles E. Campbell, Jr. [mailto:drchip@...]
          Sent: Tuesday, May 04, 2004 6:30 AM
          To: OvErboRed
          Subject: Re: Lisp in vim

          OvErboRed wrote:

          >I didn't realize they were distinct. Anyway, I tried it again just to be
          >sure, and changing the .vim file does in fact change the indentation. Is
          >there a separate set of vim language indentation files I'm not aware of?
          >
          >

          Would you please show me an example of what should be interpreted as a
          function call and
          what should be interpreted as comment. I can probably fix the
          <syntax/lisp.vim> file. The
          indenting is controlled by:
          :set lisp
          :set cpo+=p (I don't recommend this)

          also any <../vim62/indent/lisp.vim> or <../_vimfiles/indent/lisp.vim>
          (if you have :set filetype indent on).
          Do you have either of the last two files? What lisp-related options do
          you have? Could you show
          an example of the problem? Syntax highlighting should be independent of
          indenting; after all, one
          may not have "syn on" in one's <.vimrc> (ie. syntax highlighting would
          then be off).

          Regards,
          Chip Campbell
        Your message has been successfully submitted and would be delivered to recipients shortly.