5

Possible Duplicate:
Commands executed from vim are not recognizing bash command aliases
Why doesn't my vim know my alias?

say I set alias kapow='grep' in my .bashrc, which I source after.

I open vim, type

:!kapow "dude"

but vim tries to run /bin/bash kapow, when I actually wanted it to run my alias.

How does one run commands from a bashrc inside of vim (without leaving to the :shell)?

Community
  • 1
  • 1
tester
  • 21,160
  • 23
  • 84
  • 122
  • 1
    possible duplicate of [Commands executed from vim are not recognizing bash command aliases](http://stackoverflow.com/questions/4642822/commands-executed-from-vim-are-not-recognizing-bash-command-aliases) and [Why doesn't my vim know my alias?](http://stackoverflow.com/questions/5235543/why-doesnt-my-vim-know-my-alias) – Greg Hewgill Dec 07 '11 at 18:21

1 Answers1

9

The vim manual says this about :!

On Unix the command normally runs in a non-interactive shell. If you want an interactive shell to be used (to use aliases) set 'shellcmdflag' to "-ic".

Mattias Wadman
  • 10,882
  • 2
  • 41
  • 55