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
  • 22,441
  • 25
  • 88
  • 128
  • 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
  • 11,172
  • 2
  • 42
  • 57