Jimbob
23rd June 2003, 17:14
Hi,

Does anyone know how, or if its possible, to capitalise lower-case characters into upper-case characters using 'vi'? Or even vice-versa - change lower-case into upper-case.

Man page for ksh says this is possible in emacs by doing Ctrl+c. I'm sure this is also possible in vi since I remember doing it by mistake sometime ago.

Anybody any comments?

Thanks,

JImbob :)

ssellens
23rd June 2003, 17:50
Hi,

You could try this;

:s/<WORD or LETTERS you want to change>/\U(for upper) or L(for lower)&/g(if you want it to be global)

ie change name to NAME

:s/name/\U&/g

and back

:s/NAME/\L&/g

Hope this helps


Steve

naabi0
23rd June 2003, 18:02
The tilde (~) will do it.

Jimbob
23rd June 2003, 18:08
Thanks both.

It was the tilde (~) key that I was trying to think of. Must of hit it by mistake one time.

Jim

Francesco
23rd June 2003, 19:48
If you are actually _trying_ to change upper case to lower-case or vice versa, I would use the shell command tr.