Loading ...
Sorry, an error occurred while loading the content.

Re: map for capitalizing words

Expand Messages
  • Alan G. Isaac
    ... Hmm, that seems unlikely. Could you post a step-by-step example? Note that this map allows you to select an entire line or even more and get the
    Message 1 of 4 , Feb 28, 2001
    • 0 Attachment
      > On Tue, Feb 27, 2001 at 01:59:43PM -0500, Alan G. Isaac wrote:
      >> Is this of use for your capitalization goals?
      >> vmap Uu "xc<c-r>=substitute(@x,'\(\<.\)\(\S\+\)','\u\1\L\2','g')<cr><esc>`<vlU

      On Wed, 28 Feb 2001, Barrie Stott wrote:
      > Unfortunately, not as it stands. You must have things set that I don't or
      > vice-versa. With the cursor on `s' in `asdf' and in visual mode, typing `Uu'
      > leaves the cursor where it is and changes `asdf' to `aSDf': not what I
      > wanted.

      Hmm, that seems unlikely.
      Could you post a step-by-step example?

      Note that this map allows you to select an entire line
      or even more and get the capitalization you want.
      The only trick is the `vlU part, which goes back
      and gets the first letter of your visual selection
      and capitalizes it, just in case it doesn't begin a
      word. (Word beginnings are used for the substitute.)
      So try running the map as
      vmap Uu "xc<c-r>=substitute(@x,'\(\<.\)\(\S\+\)','\u\1\L\2','g')<cr><esc>
      and then manually type in
      `<vlU
      to see how you could get your odd result, which I do not get.

      Cheers,
      Alan Isaac
    Your message has been successfully submitted and would be delivered to recipients shortly.