Software⏱️ 4 min read📅 2026-06-11

How to Fix: Does reload vimrc from a terminal give an error?

Error loading .vimrc from terminal in Mavericks with iTerm and oh-my-zsh.

Quick Answer: Try sourcing ~/.vimrc directly instead of using source command.

The issue of reloading .vimrc from a terminal not giving any error can be frustrating for users, especially when they are trying to troubleshoot or customize their Vim configuration. This problem affects users who have set up their Vim environment with oh-my-zsh and are using iTerm on Mavericks.

Reloading .vimrc manually through the terminal is an essential step in customizing and troubleshooting Vim configurations, but it can be tricky if you're not aware of the potential issues that may arise. In this guide, we'll walk you through the root causes of this issue and provide two methods to resolve the problem.

💡 Why You Are Getting This Error

  • The primary reason for this error is due to the way oh-my-zsh handles source commands in its shell environment. When you run `source ~/.vimrc` in your terminal, Vim's configuration files are not sourced correctly because of the way iTerm and zsh interact with each other. This can lead to issues with file paths, syntax highlighting, and other features that rely on the correct sourcing of configuration files.
  • Another possible reason for this issue is related to the way iTerm handles file permissions and ownership. If your Vim configuration files are not owned by the correct user or have incorrect permissions, it may prevent them from being sourced correctly through the terminal.

🔧 Proven Troubleshooting Steps

Manually reload .vimrc using iTerm's built-in command

  1. Step 1: Open a new terminal window in iTerm and navigate to your home directory.
  2. Step 2: Run the following command: `source ~/.vimrc` (or `source /path/to/your/vimrcfile` if it's located elsewhere). This will reload your .vimrc file and apply any changes you've made to your configuration.
  3. Step 3: Note that this method assumes that you have not changed the ownership or permissions of your Vim configuration files. If you have made these changes, you may need to adjust them before sourcing your .vimrc file.

Create a function in zsh to source .vimrc automatically

  1. Step 1: Open your `~/.zshrc` file and add the following line at the end: `source ~/.vimrc`. This will source your .vimrc file every time you start a new terminal session.
  2. Step 2: Alternatively, you can create a function in your `~/.zshrc` file to source your .vimrc automatically. Add the following code: `function reload-vimrc { source ~/.vimrc; }` and then add the following line at the end of your `~/.zshrc`: `reload-vimrc`. This will create a new function called `reload-vimrc` that you can run whenever you want to reload your .vimrc file.
  3. Step 3: Restart your terminal session or run `source ~/.zshrc` to apply any changes to your configuration.

💡 Conclusion

By following these methods, you should be able to resolve the issue of reloading .vimrc from a terminal not giving any error. Remember to always check your file permissions and ownership to ensure that your Vim configuration files are being sourced correctly.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions