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 ?

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

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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