0

I've recently switched over to using VIM and use a friends .vimrc that works well for him

https://github.com/dtothefp/dotfilesv2/blob/master/vim/vimrc.symlink

I first installed vim through Homebrew as well as symlinking MacVim. Everything seems to work well except in a few files in my project. One .scss file freezes VIM everytime, most of the times upon trying to open it from NerdTree, but sometimes just navigating within the file. When this happens I have to completely close my Terminal tab, as well as force quit a VIM process in my Activity Monitor that goes to 100%.

I've tried many things to fix the problem such as uninstalling VIM/MacVim via Homebrew and downloading MacVim from MacPorts and symlinking it manually. I have also tried other .vimrc files and still have the same problem. I feel as if I potentially installed a bad plugin previously and it or something related is still cached somewhere on my machine.

The only time the problem does not occur is when using the VIM 7.3 compiled by Apple that shipped with my machine. Any information on debugging this problem would be greatly appreciated

  • 1
    The root issue, here, is that you use someone else's vimrc and plugins: it may work for him but you are not him and you are supposed to configure your environment. One immediate benefit of configuring your environment yourself is that you control what goes in and what goes out. When something surprising happens it's easy to find out how and why it happens. The way you installed vim, too, is a bit cowboyish. Anyway, can you provide more info on your system and a link to te offending file? – romainl Sep 12 '14 at 7:08
  • @romainl thanks for your feedback. I work for a company with the main devs I'm working with are using VIM. Therefore, it's helpful for getting up and running quickly to have a common language for commands/plugins as I work remotely from them. Anyhow, I'm running MacOS 10.9.4, 2.3GHz,i7, 16GB RAM, using ITerm. I followed this installation guide coderwall.com/p/yiot4q. The project I'm working on runs a local Node server for the build process with Grunt. The offending file is github.com/optimizely/marketing-website/blob/master/… – dtothefp Sep 12 '14 at 14:37
  • Have you tried running vim without loading vimrc and plugins (vim -u NONE) to see whether it's actually vim or not? – kejadlen Sep 12 '14 at 14:38
1

Your file freezes my Vim too. The cause is Vim's suboptimal syntax highlighting routines that choke on long lines such as 63, 66 and 69 (69 is 3342 chars long!).

You can reduce the value of 'synmaxcol' to a lower value than the default (3000) like 200 or something, YMMV:

:setlocal synmaxcol=200
  • thanks this was the answer I was looking for. Adding this line to my .vimrc fixed the crash although the file was still running very slowly. I turn off syntax highlighting for the offending file as suggested here superuser.com/questions/302186/… and it works great. Also, if you could point me in the right direction of better ways to install VIM as you mentioned previously I would greatly appreciate it – dtothefp Sep 12 '14 at 16:07
  • 1. Download MacVim and put it in your /Applications directory. 2. Put the mvim script that was in the archive somewhere in your PATH. 3. Remove anything in ~/.vimrc and ~/.vim/ that was not installed by you. – romainl Sep 12 '14 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.