5

Possible Duplicate:
Commands executed from vim are not recognizing bash command aliases

I've made an alias called "cache": alias cache="[shell command]"

Using vim, I'd like to call this alias through the ':!' directive, but I just can call "standard" commands like 'date' and so on?

How is it possible to make vim use my shell aliases?

Community
  • 1
  • 1
Olivier Pons
  • 15,363
  • 26
  • 117
  • 213

1 Answers1

11

Actually the suggested answer in the possible duplicate question didn't work for me. I currently use the following:

set shell=/bin/bash\ -i

It works fine.

lucapette
  • 20,564
  • 6
  • 65
  • 59
  • 1
    For ZSH see: http://stackoverflow.com/questions/22055613/zshell-aliases-like-gst-inside-vim – jpoppe Dec 16 '14 at 15:16
  • This does _not_ work for me. Typing `!gcc --version` runs the command but then _suspends_ vim (_not_ subshell) and shows `[1]+ Stopped    vim`. Just like using Ctrl-Z in other programs, typing `fg` gets you back to vim. … bash v4.1.2 … vim 7.4 … `shellcmdflag=-c` … `shell=/bin/bash\ -i` – Alex Quinn Aug 06 '16 at 16:42