view runtime/syntax/ondir.vim @ 35714:f7c1a8e37c0b v9.1.0592

patch 9.1.0592: runtime: filetype: Mediawiki files are not recognized Commit: https://github.com/vim/vim/commit/b5844104ab1259e061e023ea6259e4eb002e7170 Author: AvidSeeker <avidseeker7@protonmail.com> Date: Tue Jul 16 21:10:50 2024 +0200 patch 9.1.0592: runtime: filetype: Mediawiki files are not recognized Problem: filetype: Mediawiki files are not recognized Solution: detect "*.mw" and "*.wiki" as mediawiki filetype, include basic syntax and filetype plugins. (AvidSeeker) closes: #15266 Signed-off-by: AvidSeeker <avidseeker7@protonmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 17 Jul 2024 08:13:58 +0200
parents 4d5026e1c0e1
children
line wrap: on
line source

" Vim syntax file
" Language:     ondir <https://github.com/alecthomas/ondir>
" Maintainer:   Jon Parise <jon@indelible.org>

if exists('b:current_syntax')
  finish
endif

let s:cpo_save = &cpoptions
set cpoptions&vim

syn case match

syn match   ondirComment  "#.*" contains=@Spell
syn keyword ondirKeyword  final contained skipwhite nextgroup=ondirKeyword
syn keyword ondirKeyword  enter leave contained skipwhite nextgroup=ondirPath
syn match   ondirPath     "[^:]\+" contained display
syn match   ondirColon    ":" contained display

syn include @ondirShell   syntax/sh.vim
syn region  ondirContent  start="^\s\+" end="^\ze\S.*$" keepend contained contains=@ondirShell

syn region  ondirSection  start="^\(final\|enter\|leave\)" end="^\ze\S.*$" fold contains=ondirKeyword,ondirPath,ondirColon,ondirContent

hi def link ondirComment  Comment
hi def link ondirKeyword  Keyword
hi def link ondirPath     Special
hi def link ondirColon    Operator

let b:current_syntax = 'ondir'

let &cpoptions = s:cpo_save
unlet s:cpo_save

" vim: et ts=4 sw=2 sts=2: