Tuesday, 15 May 2012

Vim: delete object files on save? -


Let's say I'm working on file src / MyString.c, when I save, I want to Src / MyString to vim should be removed .o and src / MyString.debug.o or better sources / migrations. *. O

How do I configure it in my .vimrc? Thank you

I also think that you should not need it and your makefile should be enabled Take care but as long as you do not correct your makefile, it can help:

  function! Remove object () objectfile = substitute (expand ('%: p'), '.c $', '.o', '') rmcommand = "rm -f" Objectfile error = system (rmcommand) endfunction autocmd BufWritePost * .c call remove object ()    

No comments:

Post a Comment