vim
Vim Error Codes
Error codes produced by the Vim text editor, displayed in the form E### at the start of error messages. Codes cover buffer management, file I/O, search, command-line parsing, and scripting.
55 codes
references vimhelp.org/message.txt.html
· All codes 55 codes
- E10 \n not allowed in string A literal newline was used inside a string expression where only escaped sequences are permitted. Use \n instead of an actual newline character.
- E109 Missing ':' after '?' A ternary expression in Vim script is missing the colon that separates the true and false branches. The correct form is condition ? true_val : false_val.
- E117 Unknown function A call was made to a function name that Vim cannot find — either it has not been defined, the script defining it has not been sourced, or the name is misspelled.
- E119 Not enough arguments for function A built-in or user-defined function was called with fewer arguments than it requires. Check the function's signature with :help {function-name}() and supply all mandatory arguments.
- E120 Using <SID> not in a script context <SID> is a special prefix for script-local function names and may only be used inside a script file, not on the command line or in a manually typed mapping.
- E121 Undefined variable A Vim script expression references a variable that has not been assigned. Declare and initialise the variable with :let before using it.
- E122 Function {name} already exists, add ! to replace it A :function definition was attempted for a name that is already defined. Append ! to the :function command to allow overwriting the existing definition.
- E127 Cannot redefine function {name}: It is in use A function definition with ! was attempted on a function that is currently executing. Recursive redefinition is not permitted; wait until the function call stack unwinds.
- E169 Command too recursive Vim detected excessive recursion while executing commands, typically caused by an autocommand that triggers itself or a mapping that re-invokes itself without a base case.
- E17 {id} is not a valid command name The word following a colon in a user-defined command declaration is not a valid identifier. Command names must start with an uppercase letter.
- E170 Missing :endfunction A :function definition block was not terminated with a matching :endfunction. Every :function must have a corresponding :endfunction at the end of its body.
- E173 {nr} more files to edit Vim was invoked with multiple files on the command line but :q was used before all files were visited. Use :qall to quit all, or navigate through remaining files with :next.
- E185 Cannot find color scheme '{name}' The :colorscheme command was given a name for which no corresponding .vim file exists in the runtime path. Verify the scheme name and that the file is installed under colors/.
- E20 Mark not set A command referenced a mark (e.g. with the ' or ` operator) that has not been placed in the current buffer. Set the mark with m{a-z} before using it.
- E21 Cannot make changes, 'modifiable' is off An edit was attempted on a buffer whose 'modifiable' option is disabled. Set :set modifiable or use a writable buffer.
- E211 File {name} no longer available A file that was open in a buffer has been deleted or moved on disk since it was loaded. The buffer still holds the in-memory copy but the on-disk file is gone.
- E212 Can't open file for writing Vim could not open the target file for writing, typically due to a permissions error or a missing parent directory. Check file system permissions and that the directory exists.
- E216 No such event An autocommand was defined or triggered with an event name that Vim does not recognise. Run :help autocmd-events for the list of valid event names.
- E262 error in '++opt' argument An invalid value was passed to a ++ option modifier (e.g. ++enc=, ++ff=) on a file command such as :e or :w. Check that the encoding name or file format is valid.
- E303 Unable to open swap file for "{name}", recovery impossible Vim could not create a swap file for the current buffer, so crash recovery will not be available. This is often caused by a read-only directory or a full filesystem.
- E31 No such mapping A :unmap or :mapclear command referenced a key sequence that has no mapping defined. Check spelling with :map and the correct mode prefix.
- E325 ATTENTION A swap file was found for the file being opened, indicating that a previous editing session may have crashed. Vim prompts the user to recover, delete, or ignore the swap file.
- E329 No menu "{name}" A :menu, :unmenu, or :emenu command referenced a menu path that does not exist. Use :menu to list defined menus and verify the path.
- E349 No identifier under cursor A command such as K or CTRL-] that operates on the word under the cursor was invoked when the cursor is not positioned on a valid identifier character.
- E352 Cannot erase folds with current 'foldmethod' The zE command to erase all folds was used while 'foldmethod' is set to a value other than manual or marker, which does not support manual fold deletion.
- E36 Not enough room There is not enough space to open a new window via :split or :vsplit. Close some windows or increase the terminal dimensions before splitting.
- E37 No write since last change A command that would abandon the current buffer (e.g. :q, :e, :bn) was issued while there are unsaved changes. Save with :w, discard with :q!, or use :hide to leave the buffer without unloading it.
- E384 search hit TOP without match for: {pattern} A backward search reached the top of the file without finding the pattern and 'wrapscan' is disabled. Enable 'wrapscan' (:set wrapscan) to allow searches to wrap around the file.
- E385 search hit BOTTOM without match for: {pattern} A forward search reached the end of the file without finding the pattern and 'wrapscan' is disabled. Enable 'wrapscan' (:set wrapscan) to allow searches to wrap around the file.
- E39 Number expected A command argument required a numeric value but received a non-numeric string. Supply a valid integer where the command expects a count or line number.
- E45 'readonly' option is set (add ! to override) A write command was issued on a buffer opened in read-only mode. Use :w! to force the write, or :set noreadonly to clear the option first.
- E46 Cannot change read-only variable An assignment was made to a variable that is read-only, such as a built-in Vim variable prefixed with v: that does not allow modification.
- E48 Not allowed in sandbox A command that can modify files, execute shell commands, or change settings was attempted while Vim is running in sandbox mode. Sandbox mode restricts dangerous operations from untrusted scripts.
- E486 Pattern not found The regular expression supplied to a search or :substitute command matched nothing in the buffer. Check the pattern syntax and whether the target text actually exists.
- E488 Trailing characters Extra text was found after a command that does not accept arguments. Remove the trailing characters or check that the correct command was used.
- E492 Not an editor command The text typed after : is not a recognised Ex command. This commonly occurs due to a typo, a missing plugin, or using a command name from a different editor.
- E499 Empty file name for '%' or '#', only works with ':p:h' The % or # filename modifiers were expanded in a context where the buffer has no associated file name. Assign a file name with :file {name} before using these modifiers.
- E509 Cannot create diffs Vim was unable to produce a diff for the current buffers, often because the external diff tool is unavailable or produced an error. Ensure that diff is installed and accessible in $PATH.
- E515 No buffers were changed A :wall or similar write-all command found that no buffers had unsaved changes to write. This is informational rather than a fatal error.
- E553 No more items Navigation through a list such as the quickfix list, location list, or argument list has reached its boundary and there are no further entries in the requested direction.
- E63 No previous substitute regular expression The ~ or & special pattern was used in a :substitute command before any prior substitution had been performed in the session. Run a full :s/pattern/replacement/ first.
- E684 list index out of range: {nr} A List was indexed with a number that falls outside the valid range of indices. Use len() to check the List size before accessing elements by index.
- E706 List and dict are mutable A List or Dictionary was used in a context requiring an immutable value, such as a constant expression. Use a copy with copy() or deepcopy() to obtain a separate value.
- E716 Key not present in Dictionary A Dictionary lookup used a key that does not exist and the dict was not accessed with the get() function. Use get(dict, key, default) to safely retrieve optional keys.
- E717 Dictionary entry already exists An attempt was made to add a key to a Dictionary using a method that prohibits overwriting existing entries. Use direct assignment (dict[key] = value) to update an existing key.
- E730 using List as a String A List was used where a String value was expected, such as in string concatenation. Convert the List to a string with string() or join() before the operation.
- E731 using Dictionary as a String A Dictionary was used where a String value was expected, such as in string concatenation. Convert it to a string representation with string() before the operation.
- E741 Ambiguous use of user-defined command A partial command name matched more than one user-defined command. Type enough additional characters to make the command name unambiguous, or use the full name.
- E76 No matching autocommands A :doautocmd or :doautoall command was given an event and pattern for which no autocommands are currently defined. Define the autocommand with :autocmd before triggering it.
- E776 No location list A location-list command such as :lopen or :lnext was used in a window that has no associated location list. Populate the list first with a command like :lvimgrep or :lmake.
- E85 There is no listed buffer A command such as :bnext or :bprev was used but no listed buffers exist in the buffer list. Open a file with :e or :badd to populate the list.
- E855 Autocommand nesting too deep Autocommands triggered each other recursively beyond Vim's nesting limit. Inspect the autocmd chain with :autocmd and add guards such as checking a flag variable to prevent infinite re-triggering.
- E86 Buffer {nr} does not exist A command referenced a buffer by number that is not present in the buffer list. Use :ls to list valid buffer numbers.
- E927 Invalid action: '{name}' A :tab or window-management command received an unrecognised action argument. Consult :help for the command to see the list of accepted action values.
- E96 Can't use mark in other window A lowercase mark referenced via ' or ` belongs to a buffer not currently displayed. Switch to the buffer containing the mark before jumping to it.