thank you very much.

--- 11年5月8日,周日, ZyX <[email protected]> 写道:


发件人: ZyX <[email protected]>
主题: Re: how to rename the file in the buffer and automatically set the file 
directory as current directory
收件人: [email protected]
日期: 2011年5月8日,周日,下午4:14


Reply to message <<how to rename the file in the buffer and automatically set 
the 
file directory as current directory>>, 
sent 10:37:02 08 May 2011, Sunday
by yanzhisheng:

> if I open the files test1.txt in the root directory  D:\, and I want to
> rename the file name to test2.txt, how can I do that?
:call rename(expand('%'), 'test2.txt')
:call delete(expand('%'))
:bwipeout!
:edit test2.txt
or
:save test2.txt
:call delete(expand('#'))
:buffer #
:bwipeout!

> I addition, is it possible to set the current directory as the files where
> locates? fox example, if I open the file test1.txt at D:\, VIM will
> automatically set the current directory as D:\. but NOT  cd commnad
:set autochdir

Original message:
> hi,
> if I open the files test1.txt in the root directory  D:\, and I want to
> rename the file name to test2.txt, how can I do that?
> 
> I addition, is it possible to set the current directory as the files where
> locates? fox example, if I open the file test1.txt at D:\, VIM will
> automatically set the current directory as D:\. but NOT  cd commnad Thank
> you

-- 
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

Reply via email to