Thursday, August 18, 2011

RE: Make :saveas save to path of current file

lessthanideal wrote:
> Suppose the current working directory is "C:\" and I am
> editing "C:\temp\test.txt". I issue the command
>
> :saveas test2.txt
>
> The file is saved as C:\test2.txt, hHow can I make it be
> saved as C:\temp\test2.txt?

The way :saveas is working is correct because if you do not
specify a directory, Vim's current directory should be used.

What you want is something like this:
:saveas %:p:h/newname.txt

See :help filename-modifiers

I would just type that command because it's worth remembering
and should not be needed often. It would be possible to make a
user command to simplify it.

John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: