Gvim: make command doesn't work

I am in a Unix environment, working in C ++. I open gvim from a directory in which a makefile exists called "Makefile". When I try to use ": make" from within vim, I get:

shell 2 returned (1 of 1): make: *** There are no specified targets and no makefile was found. Stop.

+4
source share
3 answers

Can you check the following options?

:set shell? :set shelltype? 

Finally, check the contents of the shell login file. For example, if your shell is bash, check ~/.bashrc . Does this file have something like the following?

 cd ~ 

Or:

 cd /home/${USERNAME} 

where ${USERNAME} (obviously) is your username.

+4
source

Do you have autochdir enabled? This may change to another directory.

Refer to :pwd to see if the current directory matches.

Try running :!ls to see if the Makefile exists.

+5
source

G'day

The obvious question is: Does the Makefile work in the current directory when I type make on the command line?

Trying to split the brand on gvim land from make env. on the command line.

Also, was makeprg installed on something unexpected? What do you get when you enter:

 :set makeprg? 

By the way. A question mark is required.

Edit:

  • You have a different behavior if you enter:

    : cd the / dir / i / need / be / in

and then enter

: make

  • Is gvim an alias for anything?

NTN

amuses

+1
source

All Articles