Vi editor questions

1. How do you do the following? 
a) invert the case of all characters in the correct line
b) convert to uppercase the entire line

2. How can you number all the lines which are a) saved, b) not saved, when saving the line?

I understand the question 1 b) i.e. convert to uppercase the entire line but can't do 1 a) i.e. invert the case. Question 1 a) says (according to me) to change upper to lower case and vice versa.

I couldn't get the question number 2. i.e. numbering lines.

These questions are from the book "UNIX concepts and applicaions" by Sumitabha Das
Chapter 20, question number 20.4 and 20.11

Is this classwork?
80~

No, its not classwork. I was practicing the questions from the book mentioned in my post. I have mentioned details from where I got the question.
I hope this is the right forum to post questions from a book.
This is no homework and no classwork, simply my practice.

This is a special forum ONLY for homework questions!

Thread reopened.

1 Like

Well, googling around, I found :s/./\U&/g and :s/./\U&/ with the latter probably faster, \L for lower case, but so far no flipper in that ex space. (Also \u for just first char, \l to lower, so also :s/./\u&/g but not :s/./\u&/ ) The g~~ must be vim only, and while vim is common and downloadable it is far from universal.