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

Re: [vim] howto engspchk.vim just in c comments?

Expand Messages
  • Benji Fisher
    ... [snip] ... You can do one of the following. 1. Modify engspchk.vim to do if &ft == c || &ft == ... syn match BadWord contained ... else syn match BadWord
    Message 1 of 7 , Jan 30, 2001
      raf wrote:
      >
      > Dr. Charles E. Campbell wrote:
      >
      [snip]
      > >
      > > You'll also need to make the
      > >
      > > "syn match BadWord" -> "syn match BadWord contained"
      >
      > and make corresponding changes to the \es command
      >
      > > > how do you specify that GoodWord is to be
      > > > contained within Comment?
      > >
      > > Yes, but <engspchk.vim> already handles that; it does so with
      > > those languages' syntax highlighting files that contain clusters
      > > in their comments (which allows me to "add" both GoodWord and BadWord
      > > to their comment's contained highlighting groups).
      >
      > it works marvellously now in c comments but the spell checking has
      > disappeared from my mail messages :( can separate versions be avoided?
      >
      > > I wish there was a general way to add modifiers to specific highlighting
      > > groups (something like syn keyword Goodword addmod=contained ; that
      > > way <engpspchk.vim> wouldn't require modification for comment handling).

      You can do one of the following.

      1. Modify engspchk.vim to do

      if &ft == "c" || &ft == ...
      syn match BadWord contained ...
      else
      syn match BadWord ...
      endif

      2. Wait for the next version of engspchk.vim (so that Dr. C can do the
      above).

      3. Try my second suggestion (the one that works, not the one I snipped
      above):

      :e foo.c
      :so $CVIMSYN/engspchk.vim
      :syn clear BadWord
      :syn match BadWord contained "\<\a\{2,}\>"

      Again: it is not perfect, but it works pretty well.

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