Vim Recall繁體中文

Remove a user function

:delfunction

Example

Normal 0 / 2

Remove a user function.

Loaded functions

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

Before

Loaded functions

Twice
function(n): return a:n * 2

After

Loaded functions

Twice
absent; exists('*Twice') = 0

Documentation-backed illustration. the shown legacy function exists, is not executing, and has no outstanding references. :delfunction removes the loaded Twice definition. Primary help: :delfunction.

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

Remove a 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 :delf[unction] 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.