$ pwd: ~ / Technical Sharing / article/solving-openwrt-vim-failed-to-source-defaults-vim

Solving the 'Failed to source defaults.vim' Error in OpenWRT Vim

// Discover how to fix the 'Failed to source defaults.vim' error when using Vim on OpenWRT. This guide provides simple commands to resolve the issue and prevent it from reoccurring, ensuring a smoother editing experience without the need for extra key presses.

git-status.logreadonly
$ git log --oneline --stat
📁 category: Technical Sharing📅 updated: 2025-03-06🏷️ tags: Openwrt, Vim, Editor
article/solving-openwrt-vim-failed-to-source-defaults-vim.mdreadonly
type
status
date
slug
summary
tags
category
icon
password
After installing Vim 9.0 through OpenWRT's package manager OPKG, an error occurs when using it:
Even installing vim-full does not resolve the issue, so it's not likely a problem with missing dependencies. Although this error does not affect normal usage, it's quite annoying to have to press Enter every time you edit a file. So, I looked for a solution.

📝 Solving the 'Failed to source defaults.vim' Error Solution

Force Edit defaults.vim

Enter the following command in the OpenWRT terminal:
The result will like this return with the default vimrc profile:
After that, you won't see the error message E1187: Failed to source defaults.vim Press ENTER or type command to continue when you enter Vim again.

Symbolic Link

Another method is to create a symbolic link:

For Non-Root User

If you are a non-root user:
This will also solve the problem.

📎 Reference Articles

 
💡
If you have any questions about installing or using OpenWRT, please feel free to leave a comment at the bottom, and let's exchange ideas together~
comments.logreadonly