Re: directory question and post test too

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: directory question and post test too

Marcin Komorowski
Hello Ryx,

Looks like you sent this e-mail only to me, and not to the list.

If you are having problems with posting to the list (from your subject I am
guessing you might be) than keep this in mind:
1. you have to be a member of the list, i.e. you must have subscribed to the
list first in order to post to it
2. I had to set an option to send messages in plain text, or the list server
kept on bouncing the e-mail complaining about some MIME type problem.

Good luck with your posts.

As to your question below, you have to remember that vim is directory aware,
just like your shell.  If you type
    :pwd
it will tell you what it considers its current directory.  You can use
    :cd <dir name>
to change directories.

A quick way to change a directory to where the file you are editing is
located is
    :cd %:h

Vim substitutes % with current's buffers pathname, and the ':h' portion
strips off the file itself, leaving just the path.
You could put :cd %:h in your _vimrc file, in which case if you started vim
with
    vim d:\cplusx2\hello.cpp
it would automatically go to that directory, but it would not have any
affect on
    :e d:\cplusx2\hello.cpp
command.  This one you would have to follow with
    :cd %:h

Hope this helps.
Marcin

----- Original Message -----
From: "ryx ramos" <[hidden email]>
To: "Marcin Komorowski" <[hidden email]>
Sent: Friday, September 23, 2005 1:53 AM
Subject: directory question and post test too


> let me try too....
>
> by the way, i also have an inquiry. i am trying to learn c++. all the
> ide's out there either start slow, have configuration problems, and
> hard to understand. sometimes they dont even have good documentation
> to start with. i am having difficulty interpreting mingw installation
> and cannot find a good site for it. cygwin let you install online but
> i am an offline user. i have to go to a cafe for me to read email and
> search. not good for a newbie like me. so i found out that micrsoft
> c++ compiler is free and was able to install ms visual c++ toolkit
> 2003 including post install processes. i fire up vim (the greatest
> editor in the world! sleek, smart, swift, fully customizable) and try
> a hello world. it run. however, when i compile i have to do this
>
> :cl d:\cplusx2\hello.cpp
>
> where, cl is the command line for compiling and linking the program
> d:\cpulsx2 is the immediate directory
> hello.cpp is obviously the c++ program
>
> would it be possible to remove the immediate directory? since i have
> to fire vim like
>
> :e d:\cplusx2\hello.cpp
>
> so i was assuming that vim knows i am working in that directory. or
> should i have to configure (or add) something to _vimrc?
>
> please advise
>
> thank you
>