-1

After running :scriptnames, I found that I have the files gvimrc, runtime, and vimrc in the path /Applications/MacVim.app/Contents/Resources/vim

From my knowledge, I should be adding my plugins into a .vimrc file in my home directory. Does adding in either work? And, what is the difference between gvimrc and vimrc?

JeanieJ
  • 328
  • 3
  • 10
  • Usually, a plugin consists of a few files: usually something in `plugin`, maybe something in `autoload`, if it’s a color scheme a file in `colors`, for language support a file in `syntax` and maybe `ftplugin` and `indent`, and for every kind of plugin maybe some documentation in `doc`. To install any of these kinds of plugins, I throw those directories (`plugin`, `autoload`, `syntax`, …) directly under the `.vim` directory in my home folder, and Vim usually automatically picks them up, no `.vimrc` changes needed. – icktoofay Aug 23 '15 at 00:04
  • regarding the difference between `vimrc` and `gvimrc`, the first one is always source but the second one only when you are running vim with a GUI (i.e. with gvim). It allows to split your configuration according to where it runs (i.e fonts, plugins etc). I usually put everything in vimrc for simplicity and guard with `if has('gui_running')` if I want an option to be set only in graphical mode. A question of taste, I guess – tgo Aug 23 '15 at 16:24

1 Answers1

0

I confirm, .vimrc is used by vim AND gvim, while .gvimrc is only used by gvim.

.gvimrc is loaded after .vimrc, so you can override .vimrc config in gvim.

slashcool
  • 168
  • 7