# Language: Odin
# Maintainer: Maxim Kim <habamax@gmail.com>
# Website: https://github.com/habamax/vim-odin
-# Last Change: 2026-02-02
+# Last Change: 2026-06-01
if exists("b:did_indent")
finish
endfor
elseif pline =~ '{[^{]*}\s*$' && line !~ '^\s*[})]\s*$' # https://github.com/habamax/vim-odin/issues/2
indent = pindent
+ elseif line !~ '^\s*}' && pline =~ '^\s*\%(if\|for\).*\s\+do\%(\s\+\|$\)' # https://github.com/habamax/vim-odin/issues/15
+ indent = pindent
elseif pline =~ '^\s*}\s*$' # https://github.com/habamax/vim-odin/issues/3
# Find line with opening { and check if there is a label:
# If there is, return indent of the closing }
# Language: Odin
# Maintainer: Maxim Kim <habamax@gmail.com>
# Website: https://github.com/habamax/vim-odin
-# Last Change: 2026-05-28
+# Last Change: 2026-06-01
if exists("b:current_syntax")
finish
endif
syntax keyword odinKeyword using transmute cast auto_cast distinct where dynamic
-syntax keyword odinKeyword struct enum union bit_field bit_set
-syntax keyword odinKeyword package proc map import export foreign
-syntax keyword odinKeyword size_of offset_of type_info_of typeid_of type_of align_of
+syntax keyword odinKeyword struct enum union matrix bit_field bit_set
+syntax keyword odinKeyword package proc map import foreign typeid
syntax keyword odinKeyword return defer
-syntax keyword odinKeyword inline no_inline
syntax keyword odinKeyword asm context
syntax keyword odinConditional if when else do for switch case fallthrough
-syntax keyword odinConditional continue or_continue break or_break or_return or_else
-syntax keyword odinType string cstring bool b8 b16 b32 b64 rune any rawptr
-syntax keyword odinType f16 f32 f64 f16le f16be f32le f32be f64le f64be
-syntax keyword odinType u8 u16 u32 u64 u128 u16le u32le u64le u128le u16be
-syntax keyword odinType u32be u64be u128be uint uintptr i8 i16 i32 i64 i128
-syntax keyword odinType i16le i32le i64le i128le i16be i32be i64be i128be
-syntax keyword odinType int complex complex32 complex64 complex128 matrix typeid
-syntax keyword odinType quaternion quaternion64 quaternion128 quaternion256
+syntax keyword odinConditional continue break
+syntax keyword odinConditional or_continue or_break or_return or_else
+
+syntax keyword odinType bool b8 b16 b32 b64
+syntax keyword odinType int i8 i16 i32 i64 i128
+syntax keyword odinType uint u8 u16 u32 u64 u128 uintptr
+syntax keyword odinType i16le i32le i64le i128le u16le u32le u64le u128le
+syntax keyword odinType i16be i32be i64be i128be u16be u32be u64be u128be
+syntax keyword odinType f16 f32 f64
+syntax keyword odinType f16le f32le f64le
+syntax keyword odinType f16be f32be f64be
+syntax keyword odinType complex32 complex64 complex128
+syntax keyword odinType quaternion64 quaternion128 quaternion256
+syntax keyword odinType rune
+syntax keyword odinType string cstring
+syntax keyword odinType rawptr
+syntax keyword odinType any
+
syntax keyword odinBool true false
syntax keyword odinNull nil
syntax match odinUninitialized '\s\+---\(\s\|$\)'
-syntax keyword odinOperator in notin not_in
+syntax keyword odinOperator in not_in
syntax match odinOperator "?" display
syntax match odinOperator "->" display
syntax region odinRawString start=+`+ end=+`+
syntax region odinChar start=+'+ skip=+\\\\\|\\'+ end=+'+
syntax region odinString start=+"+ skip=+\\\\\|\\'+ end=+"+ contains=odinEscape
-syntax match odinEscape display contained /\\\([nrt\\'"]\|x\x\{2}\)/
+syntax match odinEscape display contained /\\\([abefnrtv\\'"]\|\o\{3}\|x\x\{2}\|u\x\{4}\|U\x\{8}\)/
syntax match odinProcedure "\v<\w*>(\s*::\s*proc)@="