Still unclear to me what you want.
Don't now if this is what you want, but I have the following mappings for
changing upper to lower case from any position in a line:
" ALT <- to make from current pos till begin-of-line everything lower case
" To keep the cursor position it's prepend with mz (mark pos with z)
" and append with `z (go to mark z) (notice the backtick `[located under
" the ESC-key] is used, not a single quote sign ')
noremap <M-Left> mzgu0`z
inoremap <c-\><c-n> <M-left>
" ALT -> to make from current pos till eol everything lower case "
noremap <M-Right> mzgu$`z
inoremap <c-\><c-n> <M-Right>
" ALT-SHIFT <- to make from current pos till bol everything upper case
noremap <M-S-Left> mzgU0`z
inoremap <c-\><c-n> <M-S-left>
"ALT-SHIFT -> to make from current pos till eol everything upper case
noremap <M-S-Right> mzgU$`z
inoremap <c-\><c-n> <M-S-Right>
Rgds,
Eric
From: [EMAIL PROTECTED]
To: "Theerasak Photha" <[EMAIL PROTECTED]>
CC: "Vim ML" <vim@vim.org>
Subject: Re: replace upper-case with lower-case
Date: Fri, 9 Mar 2007 14:49:09 +0800
"Theerasak Photha" <[EMAIL PROTECTED]> дÓÚ 2007-03-09 11:39:13:
> > Suppose I want to replace "start" to "stop" without changing the
> > capitalization, this will be:
> >
> > START -> STOP
> > start -> stop
> >
> > My prior question is wrong, sorry.
>
> Oh, well in that case:
>
> :%s/START/STOP/g
> :%/start/stop/g
This does not seem to be a good way, consider if we want to change:
START -> STOP
Start -> Stop
start -> stop
STart -> STop
sTART -> sTOP
...
then we may need to have too many lines...
Or imagine if we need to change ABCDEFG into HIJKLMN:
ABCDEFG -> HIJKLMN
aBCDEFG -> hIJKLMN
abCDEFG -> hiJKLMN
abcDEFG -> hijKLMN
... how many lines should you write?
write a function and change each character seem to be a more sensible
approach.
--
Sincerely, Pan, Shi Zhu. ext: 2606
_________________________________________________________________
Get a FREE Web site, company branded e-mail and more from Microsoft Office
Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/