I found how to compile the current buffer in vim with make:
set makeprg=g++\ -o\ %<\ %
I know that % means “current buffer” but I am wondering what less than sign (<) means?
Also, in this link http://vim.wikia.com/wiki/Make-compile_current_buffer mentions that %< is deprecated. Is there another way?
“%<” is expanded to the name of the current buffer without the extension. See
:help _%<.So, when you are currently editing myfile.c, your
makeprgsetting is expanded tog++ -o myfile myfile.c, which will compile myfile.c into the executablemyfile.