sponsor Vim development Vim logo Vim Book Ad

Shortcut functions for KeepCase script ( : Makes substitutions using Michael Geddes' KeepCase functions easier

 script karma  Rating 1/1, Downloaded by 509  Comments, bugs, improvements  Vim wiki

created by
Paul Hoepfner-Homme
 
script type
utility
 
description
This is a very simple script that allows you to easily do case-preserving text replacements over an arbitrary range. See vimscript #6 by Michael Geddes for the functions this script depends on.

For example:

:'<,'>call S('building','campus')

will replace all occurrences of "building" with "campus", "BUILDING_ID" with "CAMPUS_ID", "getBuilding" with "getCampus", etc. across the currently selected range.

Also included is the SS(pat,sub) function which uses KeepCaseSameLen for the substitutions instead of KeepCase.

Thanks to Michael Geddes for a great script!
 
install details
Just copy this script and vimscript #6 to ~/.vim/plugin and restart VIM.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
keepcasefun.vim 1.0 2005-06-13 6.0 Paul Hoepfner-Homme Initial upload
ip used for rating: 3.145.74.54

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github