vim, custom commands
So I am taking a programming with C course, because I don't want to use a full featured IDE which wants me to create a project and etc... I am using Vim to edit my source, currently when I want to compile I'll either send vim to the background with ctrl+z, then compile and test my program or I'll run it with :! gcc etc.... I understand vim allows you to write custom commands and I was hoping to make one to run my compile, so I could do something like :
:compile
and have it compile the file I am currently editing (everything will be single file programs)
The command would be something like
Code:
gcc -std=c99 -Wall src/myfile.c -o bin/myfile.bin
Now I get how to write that command except the output directory, I'm unsure how to specify the filename so that it's automatically the same file name but .bin instead of .c and in the bin subdirectory instead of in the src subdirectory.
"You can't expect to hold supreme executive power just because some watery tart lobbed a sword at you"
"Don't let your mind wander -- it's too little to be let out alone."
Bookmarks