Thursday, November 24, 2011

rename groups of files in vim

This came from the help inside vim.
Renaming files *rename-files*

Say I have a directory with the following files in them (directory picked at
random :-):


and I want to rename *.c *.bla. I'd do it like this: >
        $ vim
        :r !ls *.c
        :%s/\(.*\).c/mv & \1.bla
        :w !sh

You invoke the help within vim by entering the colon then typing help.

or try:

renamer.vim : Use the power of vim to rename groups of files Show a list of file names in a directory, rename then in the vim buffer using vim editing commands, then have vim rename them on disk

No comments: