End of an enum declaration
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2End of an enum declaration.
Script runtime
- Load state
not sourced
Command entered · ready to apply
Script runtime
- Load state
not sourced
Command line
- Typed text
:source enum-demo.vim- Insertion offset
21
:endenum appears in the complete source file. The completed enum defines Blue with name Blue and zero-based ordinal 1 (Vim 9.2 Vim9-enum).
Script runtime
- Color
Red, Blue- echo output
Blue 1
Before & after
Before
Script runtime
- Load state
not sourced
After
Script runtime
- Color
Red, Blue- echo output
Blue 1
Documentation-backed illustration. Vim 9.2 with enum support; enums occur at Vim9 script level; cmdheight=2 provides room for both echo output lines without a hit-enter prompt; source code is prepared as enum-demo.vim. :endenum appears in the complete source file. The completed enum defines Blue with name Blue and zero-based ordinal 1 (Vim 9.2 Vim9-enum). Primary help: :endenum.
vim9script
enum Color
Red, Blue
endenum
echo Color.Blue.name
echo Color.Blue.ordinalCursor on line 1, column 1Details & Vim help
End of an enum declaration. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.