Mercurial > vim
annotate runtime/syntax/kwt.vim @ 34387:e6defaa1e46a v9.1.0120
patch 9.1.0120: hard to get visual region using Vim script
Commit: https://github.com/vim/vim/commit/3f905ab3c4f66562f4a224bf00f49d98a0b0da91
Author: Shougo Matsushita <Shougo.Matsu@gmail.com>
Date: Wed Feb 21 00:02:45 2024 +0100
patch 9.1.0120: hard to get visual region using Vim script
Problem: hard to get visual region using Vim script
Solution: Add getregion() Vim script function
(Shougo Matsushita, Jakub ?uczy?ski)
closes: #13998
closes: #11579
Co-authored-by: =?UTF-8?q?Jakub=20=C5=81uczy=C5=84ski?= <doubleloop@o2.pl>
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 21 Feb 2024 00:15:02 +0100 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: kimwitu++ | |
3237 | 3 " Maintainer: Michael Piefel <entwurf@piefel.de> |
7 | 4 " Last Change: 2 May 2001 |
5 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
6 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
7 if exists("b:current_syntax") |
7 | 8 finish |
9 endif | |
10 | |
11 " Read the C++ syntax to start with | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
12 runtime! syntax/cpp.vim |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
13 unlet b:current_syntax |
7 | 14 |
15 " kimwitu++ extentions | |
16 | |
17 " Don't stop at eol, messes around with CPP mode, but gives line spanning | |
18 " strings in unparse rules | |
19 syn region cCppString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat | |
20 syn keyword cType integer real casestring nocasestring voidptr list | |
21 syn keyword cType uview rview uview_enum rview_enum | |
22 | |
23 " avoid unparsing rule sth:view being scanned as label | |
24 syn clear cUserCont | |
25 syn match cUserCont "^\s*\I\i*\s*:$" contains=cUserLabel contained | |
26 syn match cUserCont ";\s*\I\i*\s*:$" contains=cUserLabel contained | |
27 syn match cUserCont "^\s*\I\i*\s*:[^:]"me=e-1 contains=cUserLabel contained | |
28 syn match cUserCont ";\s*\I\i*\s*:[^:]"me=e-1 contains=cUserLabel contained | |
29 | |
30 " highlight phylum decls | |
31 syn match kwtPhylum "^\I\i*:$" | |
32 syn match kwtPhylum "^\I\i*\s*{\s*\(!\|\I\)\i*\s*}\s*:$" | |
33 | |
34 syn keyword kwtStatement with foreach afterforeach provided | |
35 syn match kwtDecl "%\(uviewvar\|rviewvar\)" | |
36 syn match kwtDecl "^%\(uview\|rview\|ctor\|dtor\|base\|storageclass\|list\|attr\|member\|option\)" | |
37 syn match kwtOption "no-csgio\|no-unparse\|no-rewrite\|no-printdot\|no-hashtables\|smart-pointer\|weak-pointer" | |
38 syn match kwtSep "^%}$" | |
39 syn match kwtSep "^%{\(\s\+\I\i*\)*$" | |
40 syn match kwtCast "\<phylum_cast\s*<"me=e-1 | |
41 syn match kwtCast "\<phylum_cast\s*$" | |
42 | |
43 | |
44 " match views, remove paren error in brackets | |
45 syn clear cErrInBracket | |
46 syn match cErrInBracket contained ")" | |
47 syn match kwtViews "\(\[\|<\)\@<=[ [:alnum:]_]\{-}:" | |
48 | |
49 " match rule bodies | |
50 syn region kwtUnpBody transparent keepend extend fold start="->\s*\[" start="^\s*\[" skip="\$\@<!{\_.\{-}\$\@<!}" end="\s]\s\=;\=$" end="^]\s\=;\=$" end="}]\s\=;\=$" | |
51 syn region kwtRewBody transparent keepend extend fold start="->\s*<" start="^\s*<" end="\s>\s\=;\=$" end="^>\s\=;\=$" | |
52 | |
53 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
54 " Only when an item doesn't have highlighting yet |
7 | 55 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
56 hi def link kwtStatement cppStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
57 hi def link kwtDecl cppStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
58 hi def link kwtCast cppStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
59 hi def link kwtSep Delimiter |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
60 hi def link kwtViews Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
61 hi def link kwtPhylum Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
62 hi def link kwtOption PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
63 "hi def link cText Comment |
7 | 64 |
65 | |
66 syn sync lines=300 | |
67 | |
68 let b:current_syntax = "kwt" | |
69 | |
70 " vim: ts=8 |