On Fri, Nov 14, 2008 at 3:31 PM, Erik Falor <[EMAIL PROTECTED]> wrote:
> > > On Fri, Nov 14, 2008 at 1:15 PM, ppi <[EMAIL PROTECTED]> wrote: > >> >> I use: >> autocmd BufEnter * lcd %:p:h >> >> If there is something better, I am interested. > > Sorry, I should have put my first response here: See :help 'autochdir' > >> >> -- paulo >> >> On Nov 14, 2:54 pm, madiyaan <[EMAIL PROTECTED]> wrote: >> > Hello: >> > >> > Is there a way to open a file relative to the current file's >> > directory? >> > >> > See :help 'autochdir' > > >> >> > I do not want to change the directory to the current file's directory >> > because I often invoke :!make from the source directory's root. (But >> > maybe there is a way to change to the current directory, and go back >> > to the root directory before invoking main... that would be equally >> > useful to me). >> > >> > For example, I am in project/ and I invoke: >> > >> > vim lib/tools/tool1.cpp >> > >> > I don't want to change my directory to project/lib/tools/ because when >> > I invoke :!make, it will use the Makefile in project/lib/tools/ and >> > not the one that I intend to use, which lies in project/. I am wanting >> > to know whether I can easily open up project/lib/tools/tool2.cpp >> > without typing in the entire path. >> > Instead of invoking :!make, try using Vim's :make command. You could, for instance, configure it via the 'makeprg' option to use a hardcoded path for the makefile, thus using the correct makefile regardless of your CWD. Also, as an added bonus, your compiler errors will go into the quickfix list so Vim will be able to jump you to any locations that have compile problems. > >> > >> > Regards, >> >> >> >> > > > -- > Erik Falor > Registered Linux User #445632 http://counter.li.org > -- Erik Falor Registered Linux User #445632 http://counter.li.org --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
