DESCRIPTION
As an add-on to the ChangeGlobally.vim plugin (vimscript #4321), this plugin
implements a gC variant that uses a "smart case" substitution which covers
variations in upper-/lowercase ("maxSize" vs. "MaxSize") as well as different
coding styles like CamelCase and underscore_notation ("maxSize", "MAX_SIZE").

The gC command works just like built-in c, and after leaving insert mode
applies the local substitution to all other occurrences (according to the
SmartCase-rules) in the current line (in case of a small character change)
or, when entire line(s) where changed, to the rest of the buffer.
This is especially useful for variable renamings and all the other small
tactical edits that you're doing frequently. It is much faster than doing a
single change and repeating it, or building a :substitute command,
especially since you would have to repeat that for all text variants that
SmartCase covers.

USAGE
[N]["x]gC{motion} Like gc, but also substitute close textual variants
{Visual}[N]["x]gC of the changed text according to the SmartCase-rules:
- variations in upper-/lowercase
("maxSize" vs. "MaxSize")
- different coding styles like CamelCase and
underscore_notation ("maxSize", "MAX_SIZE")

["x]gCC Like gcc, but with SmartCase-rules. It's probably
less useful than gC, but added for completeness.

[N]["x]gX{motion} Like gx, but also substitute close textual variants
{Visual}[N]["x]gX of the changed text according to the SmartCase-rules:
["x]gXX Like gxx, but with SmartCase-rules.

EXAMPLE
Suppose you have a line like this, and you want to rename the type from
"NodeList" to "FooBarSet", and adapt the variable name, too:
function set nodeList(nodeList:NodeList):void; // Update node list.

With the cursor on the start of any of the "nodeList", type gCe, enter the
text "fooBarSet", then press <Esc>. The line will turn into
function set fooBarSet(fooBarSet:FooBarSet):void; // Update foo bar set.
You can now re-apply this substitution to other lines or a visual selection
via .

install details

INSTALLATION
The code is hosted in a Git repo at
https://github.com/inkarkat/vim-ChangeGloballySmartCaseYou can use your favorite plugin manager, or "git clone" into a directory used
for Vim packages. Releases are on the "stable" branch, the latest unstable
development snapshot on "master".

This script is also packaged as a vimball. If you have the "gunzip"
decompressor in your PATH, simply edit the *.vmb.gz package in Vim; otherwise,
decompress the archive first, e.g. using WinZip. Inside Vim, install by
sourcing the vimball or via the :UseVimball command.
vim ChangeGloballySmartCase*.vmb.gz
:so %
To uninstall, use the :RmVimball command.

- Adapt to interface changes of ChangeGlobally.vim version 1.30
- ENH: Implement global delete (gX{motion}, gXX) as a specialization of an empty change. *** You need to update to ingo-library (vimscript #4433) version 1.021 and to ChangeGlobally.vim (vimscript #4321) version 1.30! ***

- Adapt to interface changes of ChangeGlobally.vim version 1.20
- Use optional visualrepeat#reapply#VisualMode() for normal mode repeat of a visual mapping. When supplying a [count] on such repeat of a previous linewise selection, now [count] number of lines instead of [count] times the original selection is used.