Software⏱️ 3 min read📅 2026-06-15

How to Fix: "Illegal starting char" error whenever opening MacVim

MacVim error fix: Check and update the gui_mac.txt file.

Quick Answer: Update or delete the outdated gui_mac.txt file in MacVim's Resources folder.

The 'Illegal starting char' error in MacVim occurs when the application attempts to load the viminfo file, which contains information about recently opened files. This error is frustrating because it prevents users from accessing their frequently used files, and its unclear cause makes it difficult to diagnose.

This issue affects users who have installed MacVim on their Mac operating system and are experiencing the 'Illegal starting char' error when launching the application.

⚠️ Common Causes

  • The primary reason for this error is that the viminfo file has become corrupted or outdated. The file was last updated in August 2010, which may not be compatible with the current version of MacVim.
  • An alternative cause could be a mismatch between the viminfo file and the version of MacVim being used.

🔧 Proven Troubleshooting Steps

Updating the viminfo file

  1. Step 1: Open Terminal and navigate to the Applications/MacVim.app/Contents/Resources/vim/runtime directory using the following command: cd /Applications/MacVim.app/Contents/Resources/vim/runtime
  2. Step 2: Delete the existing gui_mac.txt file by typing the following command: rm gui_mac.txt
  3. Step 3: Restart MacVim by closing and reopening it through Finder or Terminal.

Resetting the viminfo file using the 'vim' command

  1. Step 1: Open Terminal and type the following command to reset the viminfo file: :scriptnames | grep gui_mac.txt > /dev/null
  2. Step 2: Restart MacVim by closing and reopening it through Finder or Terminal.

🎯 Final Words

To resolve the 'Illegal starting char' error in MacVim, try updating the viminfo file by deleting the existing gui_mac.txt file and restarting the application. If this method doesn't work, you can also reset the viminfo file using the 'vim' command. By following these steps, you should be able to access your frequently used files without any issues.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions