Due to a quirk in the domain-specific language I am working with, I frequently face the task of (selectively, not globally) replacing term or TERM with word or WORD, respectively.
This means, I search case-insensitively for term, and want to replace that with word while keeping the uppercase / lowercase of the original term intact.
Since checking the whole of term for consistent upper-/lowercase would be difficult and is not really necessary, I would settle for uppercase / lowercase of word / WORD being decided on the first letter of term.
How could I achieve this?
cto the end of the substitution statements below, and Vim will ask you about every single match. – DevSolar Dec 02 '15 at 15:28