Reputation: 12466
vim .
Now I get the list of directory and files.
Now how can I rename a filename from that list of files?
Upvotes: 2
Views: 6041
Reputation: 149736
You can use the external mv
command like this:
:! mv oldfile newfile
Upvotes: 3
Reputation: 42040
In command mode:
:E
opens up the directory view.
R
renames the selected file. The shortcuts are listed above the listing.
If you use vim .
you can rename with R
(because it is the very same thing as above).
Upvotes: 8
Reputation: 392833
You can use qmv
(on debian-like systems apt-get install renameutils
) which does exactly that and it honours your system default editor (VISUAL, EDITOR, execvp("editor"))
qmv *.cs
opens up an editor, you can %s///g what you like, use C-a / C-x to increment/decrement numbers - in short everything you ever wanted to. You can also rename in circular fashion, e.g.
a.txt b.txt
b.txt a.txt
or
a.txt b.txt
b.txt c.txt
c.txt a.txt
etc.
Upvotes: 4