Deleting User-Commands


Since most user-commands are created in configuration files, deleting a user-command typically required deleting, or commenting out, the code that creates it. However, it is still good to quickly review the steps required to delete a user-command.

Delete global user-commands using the Lua command:

vim.api.nvim_del_user_command(
    {name}, -- string
)

where name is the name that the user-command was given when it was created.

Deleting a buffer-local user-command is similar:

vim.api.nvim_buf_del_user_command(
    {buffer number}, -- integer
    {name}, -- string
)

where buffer number is the number of the buffer from which the user-command should be deleted, or 0 for the current buffer.