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

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to