Recompile and git commit in C

1 Point

9999years 9999years

9 years ago

Map F2 to save/compile/git commit for C programming. (requires c.vim)

if filetype ==? "c"
	map <f2> :w|silent !make %:t:r.exe<cr>\rc:silent !git commit -am "save/compile"<cr>
endif

Florian Beer

Florian Beer 9 years ago

But wouldn't that potentially yield broken commits? I mean, if you commit every time you save and compile, you can't check your program for errors before it goes into git.

I am also a fan of committing quite often, but I make sure there are no syntax errors and all tests are green before committing.