End of an interface declaration
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2End of an interface declaration.
Script runtime
- Load state
not sourced
Command entered · ready to apply
Script runtime
- Load state
not sourced
Command line
- Typed text
:source interface-demo.vim- Insertion offset
26
:endinterface appears in the complete source file. The interface contains a signature without a body/enddef; Unit supplies the implementation.
Script runtime
- HasSize
interface requiring Size(): number- Unit
implements HasSize- echo output
1
Before & after
Before
Script runtime
- Load state
not sourced
After
Script runtime
- HasSize
interface requiring Size(): number- Unit
implements HasSize- echo output
1
Documentation-backed illustration. Vim9 interface support at script level; source code is prepared as interface-demo.vim. :endinterface appears in the complete source file. The interface contains a signature without a body/enddef; Unit supplies the implementation. Primary help: :endinterface.
vim9script
interface HasSize
def Size(): number
endinterface
class Unit implements HasSize
def Size(): number
return 1
enddef
endclass
var u = Unit.new()
echo u.Size()Cursor on line 1, column 1Details & Vim help
End of an interface 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.