I am trying and failing to get matchit to work.

I have the plugin at:

$ locate matchit.vim

I have tried ~/.virc:

packadd! matchit

Does it work with "vi" and not "vim"?

  • I think you need to use ~/.vimrc for vim. And I don't think you need to do packadd on matchit, it's used by default. Just make sure the version of vim you're using is the full-version, not one of those vim-minimal etc. – klaus May 17 '19 at 3:15
  • :h matchit-install – Christian Brabandt May 17 '19 at 8:52
  • I use vi, not vim. So it will not work with vi then? I have always reverted back to vi after trying vim. Can't recall why. I might have to try it again. I think it may have been the syntax highlighting. Maybe I can disable that? I suppose that's a different question ... – squarewav May 18 '19 at 23:50
  • UPDATE: I got it to work with vim but not vi. It does not appear to work with vi. I had to install vim-enhanced, add "packadd! matchit" to ~/.vimrc and then running vim (instead of vi) worked. – squarewav Jun 3 '19 at 3:12

As @Klaus already mentioned in his comment, the correct file name for the initialization file is ~/.vimrc. The file ~/.virc is not loaded at all.

You can check the loaded files by executing the command


Also the matchit plugin is an optional plugin. The path to it contains /opt/.

" matchit is optional          ^^^

So you need packadd! matchit.

BTW: If the path to a plugin contains start instead of opt it would be enabled by default. AFAIK the default Vim contains no plugin that is enabled by default. This might be different for binary distributions/packages build by third parties.

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.