After I make&make install vim from source, I found many symbolic links of vim in /usr/local/bin, such as evim, rvim, view...

The vim(1) man page said that "rvim" is equivalent to "vim -Z" and so on.

Now I wonder: can I make such a symbolic link with ln(1) myself, and if so, how?

  • 2
    Do you mean make && make install? Just one & would compile in the background and try to install in the foreground.
    – Kevin
    Mar 2 '12 at 16:29
  • @Kevin It's a matter of habit,I think.
    – bigeast
    Mar 3 '12 at 15:39

You can't without writing a bit of code.

Those symlink shortcuts work because vim is written that way. It looks at how (with what name) it was started and acts as if it had been called with the appropriate command line options.
This behavior is hardcoded in the executable, it is not a trick done by the symbolic link.

So if you want to do that yourself, the easiest is to write a small wrapper script that execs vim with the options you want:

exec vim <options you want> "$@"

The "$@" at the end simply passes any command line options given to the script along to vim.


You can do this in a roundabout way via your shell configuration. Something like

alias big_vim='gvim -p -geom 126x512'

would work in bash/zsh. It allows you to customise things without messing with sudo/root.

NOTE. To make the alias persistent (i.e. working in new terminal), add it to your ~/.bashrc:

echo "alias big_vim='gvim -p -geom 126x512'" >> ~/.bashrc 

You can't do that.

VIM check it's running path on start , e.g by linking original binary to rvim , running path become /path/to/rvim , in that case , VIM will add the -Z parameter automatically even if you didn't specify that.

But if you're only running VIM in terminal , you should:

For bash , add an alias to ~/.bashrc

alias vim='vim -Z'

Change the parameter to suit your need.

For csh / tcsh , remove the = symbol ,

e.g alias vim vim -Z

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.