Vim Tips Wiki
(adjust Template:ScriptComments to remove id as no longer needed; minor tweaks)
(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 2: Line 2:
   
 
==Comments==
 
==Comments==
SubstituteCase is too much typing, and I find the <tt>\c</tt> to be redundant, so I've added the following to my version of the script:
+
SubstituteCase is too much typing, and I find the <code>\c</code> to be redundant, so I've added the following to my version of the script:
 
<pre>
 
<pre>
 
:command! -nargs=1 -range SC
 
:command! -nargs=1 -range SC

Latest revision as of 09:53, 14 July 2012

Use this page to discuss script 6 keepcase: functions for case-persistent substitutions

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Comments[]

SubstituteCase is too much typing, and I find the \c to be redundant, so I've added the following to my version of the script:

:command! -nargs=1 -range SC
      \ <line1>,<line2>call s:SubstituteCase(
      \<f-args>[0] . '\c' . strpart(<f-args>, 1))

Usage is now much shorter, and looks a lot more like a normal substitution:

:%SC/foobar/BarBaz/g