Why doesn't my vim know my alias?

前端 未结 3 1383
后悔当初
后悔当初 2021-01-05 04:11

I have used \"alias ruby=ruby1.9.1\", so I can execute my ruby with this:

ruby 123.rb

or

ruby1.9.1 123.rb

3条回答
  •  长情又很酷
    2021-01-05 05:11

    When Vim starts a process it makes a system call. It has only inherited the environment variables from your shell if you started it from the shell. But it won't know your bash aliases.

    Bash aliases are only a convenience when you enter a command line in the Bash shell. They are expanded by Bash only.

    If you want real aliases put symlinks in a private hidden folder, and add that folder to your PATH, or use the alternatives facility.

提交回复
热议问题