Install vimrc makeprg in custom script if no Makefile

I want the command to :make

run fine if present Makefile

. Otherwise, I want it to execute a custom script, say called compile

. If no file is present I would like it to fail gracefully (ideally not leaving the edit screen).

I am aware of this thread which presents a bash expression that I was able to adapt to suit my needs. EXCEPT I sometimes need to start a shell other than bash. Is there a shell-independent way to do this?

+3


source to share


1 answer


makeprg

the name of any executable file can be given. Create a shell script that runs make

if there is a Makefile, runs compile

or returns otherwise .



+1


source







All Articles