2

I am using zsh on macOS. When I type vim, it opens, but it is completely frozen:

Anything I press on the keyboard does not display or change the window. In order to exit, I have to terminate the terminal session.

I did recently uninstall Homebrew, so it could be that this corrupted the program.

Does anyone know how this can be fixed? Is there a way to reinstall or update the system Vim (preferably, without Homebrew – it causes more problems than it solves).

1
4

When vim starts, it reads these two files from your home folder:

  • .vimrc, a configuration file that contains initialization commands
  • .viminfo, a history file that contains, among others, string and pattern search information

vim may become unresponsive if any of these two files are very large or contain corrupt entries.

To prevent vim from reading them, either:

  1. Rename them:

     cd ~
     mv .vimrc .vimrc.bak
     mv .viminfo .viminfo.bak
    

    where ~ is shorthand for your home folder.

    (Ignore any No such file or directory errors, it just means the file doesn't exist.)

  2. and start vim as usual:

     vim
    

or, alternatively, start vim as follows:

vim -u NONE -i NONE

where the -u NONE option tells vim not to read ~/.vimrc and -i NONE achieves the same result for ~/.viminfo.

If vim starts normally, you can rename back one file at a time to find the culprit and delete it.

If you want to find out more about the differences between .vimrc and .viminfo, see this answer. For information on the use of ~, see the Bash or Zsh manual.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .