Skip to content

Instantly share code, notes, and snippets.

@branquito
Created March 1, 2013 18:46
Show Gist options
  • Save branquito/5066811 to your computer and use it in GitHub Desktop.
Save branquito/5066811 to your computer and use it in GitHub Desktop.
#JOOMLA comp-rename-script
## Substitution facility script for VIM, useful in JOOMLA developing:
_by branquito de munze
# go into folder where you will be processing substitutions on files
cd vim-processing\com_somecomponent\
# load files in which you want changes to occure, filtered by extension
arg **/*.php
argadd **/*.xml
# add as many as you need
argadd **/*.extension
# turnoff ignorecase
set noic
# change ocurrences in files in this order, singular instance first
# all cases
# we had special situation here, because we shouldn't change anything that looks like domainsup
# so any character except [s] which is to prevent plurals changing first, should you need to add
# it or add them, you put them into square parenthesis
argdo %s/domain[^sup]\@=/lead/geI | update
argdo %s/Domain[^sup]\@=/Lead/geI | update
argdo %s/DOMAIN[^sup]\@=/LEAD/geI | update
#then plural
# all cases
argdo %s/domains[^upUP]\@=/leads/geI | update
argdo %s/Domains[^upUP]\@=/Leads/geI | update
argdo %s/DOMAINS[^upUP]\@=/LEADS/geI | update
# here ordinary situation
argdo %s/sale[^sS]\@=/backorder/geI | update
argdo %s/Sale[^sS]\@=/Backorder/geI | update
argdo %s/SALE[^sS]\@=/BACKORDER/geI | update
argdo %s/sales/backorders/geI | update
argdo %s/Sales/Backorders/geI | update
argdo %s/SALES/BACKORDERS/geI | update
# after you do all that, go to this link to see how to rename multiple files
# by regex..
[batch rename files recursively through folders](https://gist.github.com/5061382)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment