Search code examples
vi

How compile C in vi and run it?


Environment: MacOS, gcc, Vim7.2

I know I can do it in Emacs. Compile code and run it. I am wondering how can I do it in vi? I don't want to switch from vi to terminal a lot. thanks! :)


Solution

  • By typing ! you can execute any shell command by the way. You can type : to write a command and then write :

    :!make