Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions indent/vbnet.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" Vim indent file
" Language : VisualBasic.NET
" Maintainers: OGURA Daiki
" Last Change: 2013-01-25
" Maintainers: OGURA Daiki, MATSUSHIMA Kazuhiro
" Last Change: 2017-12-27

if exists("b:did_indent")
finish
Expand Down Expand Up @@ -45,15 +45,14 @@ function VbNetGetIndent(lnum)

if previous_line =~? 'Then$'
return ind + &l:shiftwidth
elseif previous_line =~? '^\s*\<\(Select Case\|Else\|ElseIf\|For\|While\|Using\|Try\|Catch\|Finally\)\>'
elseif previous_line =~? '^\s*\<\(Select Case\|Else\|ElseIf\|For\|While\|Using\|With\|Try\|Catch\|Finally\)\>'
return ind + &l:shiftwidth
elseif previous_line =~? '^\s\+}$'
return &l:shiftwidth + &l:shiftwidth
endif

if previous_line =~? 'End \(If\|Case\|Try\|Sub\|Function\|Class\|Operator\)$'
if previous_line =~? 'End \(If\|Case\|While\|Using\|With\|Try\|Sub\|Function\|Class\|Operator\)$'
return ind

endif

" labels and preprocessor get zero indent immediately
Expand Down
13 changes: 8 additions & 5 deletions syntax/vbnet.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" Vim syntax file
" Language : VisualBasic.NET
" Maintainers: OGURA Daiki
" Last Change: 2013-01-25
" Maintainers: OGURA Daiki, MATSUSHIMA Kazuhiro
" Last Change: 2017-12-29

if version < 600
syntax clear
Expand Down Expand Up @@ -57,15 +57,17 @@ syn match vbnetDefAnonymousTypedef "=\s\<New\> \(With$\|With {$\)"
syn keyword vbnetProperty Property Get Set
syn match vbnetPropertyEnd "^\s*End \(Get\|Set\|Property\)$"

syn keyword vbnetKeyword ByVal GetType ParamArray On Option Optional Exit Imports
syn keyword vbnetKeyword ByVal ByRef GetType ParamArray On Option Optional Exit Imports
syn keyword vbnetException Try Catch Finally Throw
syn match vbnetException "\<End\> Try$"
syn match vbnetUsing Using
syn keyword vbnetUsing Using
syn match vbnetUsing "\<End\> Using$"
syn keyword vbnetWith With
syn match vbnetWith "\<End\> With$"
syn keyword vbnetOperator New And Or AndAlso OrElse Is Not IsNot Like Mod
syn keyword vbnetBoolean True False
syn match vbnetDelimiter "\(,\|\.\|:\|{\|}\|\s_$\)"
syn keyword vbnetDeprecated Do Until Loop Goto Redim GoSub Resume Erase Preserve IIF ByRef
syn keyword vbnetDeprecated Do Until Loop Goto Redim GoSub Resume Erase Preserve IIF Call
"}}}

syn keyword vbnetConst MyBase MyClass Me Nothing
Expand Down Expand Up @@ -133,6 +135,7 @@ if version >= 508 || !exists("did_vbnet")
hi link vbnetKeyword Keyword
hi link vbnetException Exception
hi link vbnetUsing Exception
hi link vbnetWith Conditional
hi link vbnetAttribute PreProc
hi link vbnetStorage StorageClass
hi link vbnetModifier vbnetStorage
Expand Down