:!gcc -o somename % && ./somename
When using :!
, % will be substituted by the name of the currently opened file.
When your project becomes larger, you can also write a makefile and compile the current project with :make
, if there are any errors, vim will jump to them automatically.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…