Vim Recall繁體中文

Disassemble Vim9 user function

:disassemble

Example

Normal 0 / 3

Disassemble Vim9 user function.

Loaded Vim9 function

vim9script
def g:Twice(n: number): number
  return n * 2
enddef
g:Twice
defined
Source file
typed-twice.vim
Before & after

Before

Loaded Vim9 function

vim9script
def g:Twice(n: number): number
  return n * 2
enddef
g:Twice
defined
Source file
typed-twice.vim

After

Loaded Vim9 function

vim9script
def g:Twice(n: number): number
  return n * 2
enddef
g:Twice
compiled
Source file
typed-twice.vim

Disassembly contents (summary)

g:Twice
load argument n; push number 2; numeric multiply; return value
Display
actual instruction formatting depends on Vim version

Documentation-backed illustration. Vim9 support; typed-twice.vim was sourced with the shown global :def; cmdheight=1 and nomore. :disassemble displays the instructions for g:Twice; the panel summarizes their operations without asserting version-specific opcode spelling. Primary help: :disassemble.

Sample buffer
vim9script
def g:Twice(n: number): number
  return n * 2
enddef
Cursor on line 1, column 1
Details & Vim help

Disassemble Vim9 user function. 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. The index spelling :disa[ssemble] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative. Vim9 script constructs require the documented Vim9 script context.