Skip to content

Commit 63e6759

Browse files
committed
vim: re-organise import keyword, component highlighting
1 parent 91ec0e3 commit 63e6759

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

utils/vim/syntax/swift.vim

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ if exists("b:current_syntax")
77
finish
88
endif
99

10-
syn keyword swiftImport import skipwhite nextgroup=swiftImportModule
11-
12-
syn match swiftImportModule /\<[A-Za-z_][A-Za-z_0-9]*\>/ contained nextgroup=swiftImportComponent
13-
syn match swiftImportComponent /\.\<[A-Za-z_][A-Za-z_0-9]*\>/ contained nextgroup=swiftImportComponent
14-
1510
syn keyword swiftKeyword
1611
\ associatedtype
1712
\ break
@@ -49,6 +44,9 @@ syn keyword swiftKeyword
4944
\ where
5045
\ while
5146

47+
syn keyword swiftImport skipwhite nextgroup=swiftImportModule
48+
\ import
49+
5250
syn keyword swiftDefinitionModifier
5351
\ dynamic
5452
\ internal
@@ -92,6 +90,11 @@ syn keyword swiftVarDefinition skipwhite nextgroup=swiftVarName
9290
\ let
9391
\ var
9492

93+
syn match swiftImportModule contained nextgroup=swiftImportComponent
94+
\ /\<[A-Za-z_][A-Za-z_0-9]*\>/
95+
syn match swiftImportComponent contained nextgroup=swiftImportComponent
96+
\ /\.\<[A-Za-z_][A-Za-z_0-9]*\>/
97+
9598
syn match swiftTypeName contained nextgroup=swiftTypeParameters
9699
\ /\<[A-Za-z_][A-Za-z_0-9\.]*\>/
97100
syn match swiftVarName contained skipwhite nextgroup=swiftTypeDeclaration

0 commit comments

Comments
 (0)