sponsor Vim development Vim logo Vim Book Ad

FindMakefile : Change directory to one containing a Makefile

 script karma  Rating 8/2, Downloaded by 835  Comments, bugs, improvements  Vim wiki

created by
Craig Emery
script type
Change directory to the directory containing the current file and then repeatedly "cd .." until ./Makefile exists.
You run it by enterning :call FindMakefile()
I've mapped <F4> to a function that calls FindMakefile () and then does "mak %<.o"
I needed this because using tags to jump to a source file sometimes left me with the wrong current working directory for this to work.
install details
Add the function to your .vimrc file.

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
FindMakefile.vim 1.0 2003-10-20 6.0 Craig Emery Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.