neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

config.vim (2319B)


      1 " Vim syntax file
      2 " Language:		Autoconf M4
      3 " Former Maintainer:	Christian Hammesr <ch@lathspell.westend.com>
      4 " Last Change:	2018 Feb 03
      5 " 				(patch from Yngve Inntjore Levinsen to detect AC_MSG)
      6 " 				(patch from Khym Chanur to add @Spell)
      7 " 				(patch from James McCoy to fix paren matching)
      8 " 				(2025 Sep 14 patch from Damien Lejay to detect unportable +=)
      9 " 				(2025 Sep 18 by Vim Project: fix inconsistent group name)
     10 
     11 " Well, I actually even do not know much about m4. This explains why there
     12 " is probably very much missing here, yet !
     13 " But I missed good highlighting when editing my GNU autoconf/automake
     14 " script, so I wrote this quick and dirty patch.
     15 
     16 
     17 " quit when a syntax file was already loaded
     18 if exists("b:current_syntax")
     19  finish
     20 endif
     21 
     22 " define the config syntax
     23 syn match   configdelimiter "[()\[\];,]"
     24 syn match   configoperator  "[=|&\*\+\<\>]"
     25 syn match   configcomment   "\(dnl.*\)\|\(#.*\)" contains=configDnl,@Spell
     26 syn match   configfunction  "\<[A-Z_][A-Z0-9_]*\>"
     27 syn match   confignumber    "[-+]\=\<\d\+\(\.\d*\)\=\>"
     28 syn keyword configDnl   	dnl contained
     29 syn keyword configkeyword   if then else fi test for in do done
     30 syn keyword configspecial   cat rm eval
     31 
     32 " This shortens the script, see syn-ext-match..
     33 syn region  configstring    start=+\z(["'`]\)+ skip=+\\\z1+ end=+\z1+ contains=@Spell
     34 
     35 " Anything inside AC_MSG_TYPE([...])  and AC_MSG_TYPE(...) is a string.
     36 syn region  configmsg matchgroup=configfunction start="AC_MSG_[A-Z]*\ze(\[" matchgroup=configdelimiter end="\])" contains=configdelimiter,@Spell
     37 syn region  configmsg matchgroup=configfunction start="AC_MSG_[A-Z]*\ze([^[]" matchgroup=configdelimiter end=")" contains=configdelimiter,@Spell
     38 
     39 " Help write portable shell code
     40 syn match configPlusEq '\v\+\=' containedin=ALLBUT,configcomment
     41 
     42 " Define the default highlighting.
     43 " Only when an item doesn't have highlighting yet
     44 
     45 hi def link configdelimiter Delimiter
     46 hi def link configoperator  Operator
     47 hi def link configcomment   Comment
     48 hi def link configDnl  	 Comment
     49 hi def link configfunction  Function
     50 hi def link confignumber    Number
     51 hi def link configkeyword   Keyword
     52 hi def link configspecial   Special
     53 hi def link configstring    String
     54 hi def link configmsg       String
     55 hi def link configPlusEq    Error
     56 
     57 
     58 let b:current_syntax = "config"
     59 
     60 " vim: ts=4