Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Searching over net shows :f filename would rename the current file in vim. But executing this and later exiting vim, shows the new file with all the contents and also the old file is present with the saved content untill executing the above command.

So, how can we rename the current file we are editing in vim ?

EDIT - Any solution that does not involve a plugin, as I guess that would require administrative privileges which I don't have. Any tweaks with config or mapping ?

share|improve this question
You do not need root privileges to install normal vim plugins. As normal user, you can install them to the .vim subdirectory in your home folder. – jofel Jan 31 '13 at 15:05
up vote 1 down vote accepted

I found this plugin as useful for you. Once you install it you get the opportunity to use :rename, which does what the mv command does on Unix. Also you might get some ideas from here for other alternatives.

share|improve this answer
It would be nice if you can add a short explanation on each link. – Bernhard Jan 31 '13 at 12:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.