A filetype detection plugin I'm using failed to work reliably across systems. It's one of the things I use only on a couple of systems at work, so I've put it in ~/.vim.local/ftdetect/filetype.vim. ~/.vim.local is something I add to my runtimepath (along with my ~/.vim directory that's the same across all systems I use).

The reason it didn't work was that only one of the two systems' /etc/vimrc was calling:

:filetype plugin on

Since that gets run before my ~/.vimrc, my runtimepath hasn't yet been setup. As far as I can tell, there's no way to disable /etc/vimrc (SYS_VIMRC_FILE) from within .vimrc, because of the order in which they're sourced. Is that accurate?

In Zsh, I always disable the global startup files from within my own startup files to avoid these same kinds of cross-distribution differences. If it's not possible, I'll switch to explicitly using `vim -u ~/.vimrc` (via an alias). Anything to watch out for in that case? (Trying it on the affected system throws a few warnings, due to different plugin load order, but that's somewhat expected.)

I really prefer the in-.vimrc method, because the "don't run global rc" option is self-contained. (So that it works even in cases where aliases aren't active, for example, and configuring Vim the way I want it only involves rsync'ing my ~/.vim directory.)

--
Best,
Ben

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to