Jacobo de Vera
Jacobo de Vera

Reputation: 1933

How can I specify a different configuration for Vim based on the executable name?

I am trying to open Vim with different configuration options depending on the executable file name. I intend to create a number of symbolic links to vim and I'd like to do something like this in my .vimrc

if execname == "vim2"
   " configuration here
endif

Is there a variable in Vim that holds the name of the executable file being run? Alternatively, is there another way I can have different configurations without having to keep more than one .vimrc file?

Upvotes: 1

Views: 155

Answers (2)

Neg_EV
Neg_EV

Reputation: 2060

You are looking for the variable v:progname.

Upvotes: 1

DVK
DVK

Reputation: 129403

You can simply make each desired name to be an alias which first renames .vimrc.configX into .vimrc before calling vim

Upvotes: 0

Related Questions