Vim: multi-file editing - having different makes in different splits
Posted
by gmatt
on Stack Overflow
See other posts from Stack Overflow
or by gmatt
Published on 2010-03-11T19:48:46Z
Indexed on
2010/03/11
20:04 UTC
Read the original article
Hit count: 242
I'm a recent vim convert (from fancy IDEs like eclipse.)
I love the :make
command in vim and use it extensively; however I also like to edit multiple projects (with separate makefiles.)
So usually to edit more than one project I will do
pushd project1
vim project1.cpp
[suspend signal]
pushd ../project2
vim project2.cpp
and now I can switch between the two projects with ctrl+z
i.e. suspend signal, and fg
.
When this becomes an issue is when I want to open one project in the context of another so I can do copy/pasting. So if instead in the above I do
pushd project1
vim project1.cpp
:vsp ../project2/project2.cpp
I can edit both concurrently in the same vim process, however I can't effectively build one or the other with the :make
command, it will only build project 1.
Does anyone have some kind of scheme that gives them the best of both worlds: being able to edit concurrently while still being able to build multiple projects with the :make
command all from the same vim process?
© Stack Overflow or respective owner