Skip to content

Commit

Permalink
vim: move the declaration keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
compnerd committed Jun 4, 2016
1 parent 3dab5cd commit 9a326fa
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions utils/vim/syntax/swift.vim
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ syn keyword swiftFuncKeyword
syn keyword swiftScope
\ autoreleasepool

syn keyword swiftMutating skipwhite nextgroup=swiftFuncDefinition
\ mutating
syn keyword swiftFuncDefinition skipwhite nextgroup=swiftFuncName,swiftOperator
\ func

syn keyword swiftTypeDefinition skipwhite nextgroup=swiftTypeName
\ class
\ enum
Expand All @@ -83,6 +88,10 @@ syn keyword swiftTypeDefinition skipwhite nextgroup=swiftTypeName
\ struct
\ typealias

syn keyword swiftVarDefinition skipwhite nextgroup=swiftVarName
\ let
\ var

syn match swiftTypeName contained nextgroup=swiftTypeParameters
\ /\<[A-Za-z_][A-Za-z_0-9\.]*\>/

Expand All @@ -107,15 +116,13 @@ syn match swiftArchetype contained skipwhite nextgroup=swiftTypeDeclaration
syn keyword swiftConstraint contained
\ where

syn keyword swiftMutating mutating skipwhite nextgroup=swiftFuncDefinition
syn keyword swiftFuncDefinition func skipwhite nextgroup=swiftFuncName,swiftOperator
syn match swiftFuncName /\<[A-Za-z_][A-Za-z_0-9]*\>/ contained skipwhite nextgroup=swiftTypeParameters

syn keyword swiftVarDefinition var skipwhite nextgroup=swiftVarName
syn keyword swiftVarDefinition let skipwhite nextgroup=swiftVarName
syn match swiftVarName /\<[A-Za-z_][A-Za-z_0-9]*\>/ contained
syn match swiftFuncName contained skipwhite nextgroup=swiftTypeParameters
\ /\<[A-Za-z_][A-Za-z_0-9]*\>/

syn match swiftImplicitVarName /\$\<[A-Za-z_0-9]\+\>/
syn match swiftVarName contained
\ /\<[A-Za-z_][A-Za-z_0-9]*\>/
syn match swiftImplicitVarName
\ /\$\<[A-Za-z_0-9]\+\>/

syn match swiftTypeDeclaration /:/ skipwhite nextgroup=swiftType
syn match swiftTypeDeclaration /->/ skipwhite nextgroup=swiftType
Expand Down

0 comments on commit 9a326fa

Please sign in to comment.