Vim Recall繁體中文

Run a command in debugging mode

:debug

Example

Normal 0 / 3

Run a command in debugging mode.

Loaded legacy function

function! Twice(n) abort
  return a:n * 2
endfunction
Before & after

Before

Loaded legacy function

function! Twice(n) abort
  return a:n * 2
endfunction

After

Loaded legacy function

function! Twice(n) abort
  return a:n * 2
endfunction

Debugger

Context
function Twice
Next command
return a:n * 2
a:n
3
Prompt
>

Documentation-backed illustration. Twice is loaded with the shown body; :debug and +eval are available. Stop before call Twice(3). The function has not been entered; use step to enter it. Primary help: :debug.

Sample buffer
alpha
beta
gamma
Cursor on line 1, column 1
Details & Vim help

Run a command in debugging mode. 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 :deb[ug] 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.