Can I Rename Files In A Directory With Vim?


Answer :

Yes, it can't be done like that.

That "file-browser-type interface" is provided by a built-in plugin called netrw. It is read-only so yeah, you can't modify it.

You are supposed to hit R to rename the file under the cursor or the marked files.

See :help netrw, :help netrw-browse-maps and more specifically :help netrw-R.

If you want to batch-rename files using Vim you should try qmv from the renameutils package or vidir from the moreutils package (thanks to Dmitry for the heads up).


Check out the renamer.vim - Use the power of vim to rename groups of files plugin (now purely maintained on GitHub). Like netrw, it presents the directory contents in a scratch buffer, and then lets you edit that buffer, and finally apply the edits to the underlying files.


Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?