How to Fix: sourcing the .vimrc gives E174 error
Error fixing .vimrc sourcing issue in vim on Mac os X.
📋 Table of Contents
The error E174: Command already exists: add ! to replace it occurs when you attempt to reload your .vimrc filewithout restarting Vim, which is a common issue for users who frequently edit their configuration files. This problem affects Mac OS X users who are using the Vim text editor.
This error can be frustrating because it prevents you from updating your .vimrc settings without having to restart the application. However, don't worry, we have some solutions to help you reload your .vimrc file and get back to work quickly.
⚠️ Common Causes
- The first main reason why this error happens is that Vim has a built-in feature called 'command history' which remembers all the commands you've entered. When you try to reload your .vimrc file, Vim checks if there's already an existing command with the same name (in this case, 'add !'). If it finds one, it displays the error message E174.
- Another alternative reason could be that there's a syntax error in your .vimrc file. If Vim detects a syntax error while parsing your configuration file, it may also display the E174 error.
🛠️ Step-by-Step Verified Fixes
Reload vimrc using :source
- Step 1: Open Vim and navigate to the directory where your .vimrc file is located.
- Step 2: Type ':source ~/.vimrc' (or the actual path to your .vimrc file) in the command line. Press Enter to execute the command.
- Step 3: This will reload your .vimrc file without restarting Vim, allowing you to test your changes.
Unload and reload vimrc using :source !
- Step 1: Open Vim and navigate to the directory where your .vimrc file is located.
- Step 2: Type ':unload all' (or ':so ~/.vimrc !') in the command line. Press Enter to execute the command.
- Step 3: This will unload any existing commands from your .vimrc file, allowing you to reload it without conflicts.
🎯 Final Words
By following these steps, you should be able to reload your .vimrc file and fix the E174 error. Remember to always back up your configuration files before making changes, and if you're still having trouble, consider seeking help from a Vim expert or online community.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Fix Pc crashes shortly after launching game (rainbow six siege). Compl
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: New PC build- no signal and no clue
Fix New PC build- no signal and no clue. Complete troubleshooting guid