I cannot get per-project vimrc (`set exrc`) to work with vimHugeX

Hello,

Have you managed to get per project vimrc, set exrc working with vimHugeX (same as vim_configurable)?

My config looks like this -

	(
        pkgs.vimHugeX.customize
		{
			name = "vi";
			vimrcConfig.customRC = ''
				set exrc
			'';
		}
	)

But when I have a .vimrc file in my directory, it doesn’t take any effect.

Per project vimrc works fine with regular vim derivation installed using nix-env -iA channelname.vim.

Do you know what might I be doing wrong?

The use of customize here causes vim to be passed -u with a custom vimrc file (generated from the customization). The usage of -u like this bypasses a big chunk of initialization. In particular, it bypasses sourcing the system vimrc, file, the user vimrc file, and the exrc support.

In order to do what you want, you’ll have to reimplement the exrc behavior yourself in your custom vimrc file. Which is to say, check for the presence of .vimrc, _vimrc, or .exrc in the current dir, and source the first one you find. The first two files expect compatible to be off by default, but IIRC the vimrc generated by customize already disables that so you can ignore that part.

1 Like