Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
1  
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
add comment

3 Answers

up vote 18 down vote accepted

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:

#!/bin/sh
exec vim <options you want> "$@"

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

share|improve this answer
add comment

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.

share|improve this answer
1  
This will not work with bash by the way... The alias should be defined alias big_vim='gvim -p -geom 126x512' instead. –  Herman Torjussen Mar 2 '12 at 12:27
    
@hesse: Thank you. –  Sardathrion Mar 2 '12 at 12:55
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.