Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Using "make" with VIM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
mercurator
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2004
Posts: 92
Location: Slovenia

PostPosted: Tue Aug 17, 2004 11:24 am    Post subject: Using "make" with VIM Reply with quote

Hi, I'm trying out the VIM ( gvim ) and I'm having some problems with the make command. I get the following error:

Code:

:!make 2>&1 tee /tmp/v766424/3
make: *** No targets specified and no makefile found. Stop.


Here's what it did; I've created a folder and written a .c source file and a Makefile to go allong. As it seems VIM does not know where to look for the makefile. So how do I specify that location?

Bye,
_________________
"Ignorantia non est Argumentum" - Benedict de Spinoza
Back to top
View user's profile Send private message
jwj
Apprentice
Apprentice


Joined: 07 May 2004
Posts: 240

PostPosted: Tue Aug 17, 2004 11:55 am    Post subject: Reply with quote

You could try the option
Code:

" automatically change to the directory of the edited file
set autochdir

in your ~/.vimrc.
Back to top
View user's profile Send private message
jwj
Apprentice
Apprentice


Joined: 07 May 2004
Posts: 240

PostPosted: Tue Aug 17, 2004 12:01 pm    Post subject: Reply with quote

If the Makefile lies in a upper directory of the file you are editing I have this function in my ~/.vimrc to make:
Code:

map <F4> :call FindMakefile()<cr>

function! FindMakefile ()
  exec "cd " . expand ("%:p:h")
  while ! filereadable (getcwd () . "/Makefile") && getcwd () != "/"
    cd ..
  endwhile
  cd .
  make
endfunction
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum