As I said in the comments using multi cursors (even with a plugin) isn't really "following the vimVim way", I totally understand that it is attractive for someone coming from Sublime-Text but you can often find alternatives which are at least as efficient with vimVim built-in features.
Of course, finding these alternative solutions isn't always easy and sometimes it takes time but it will get easier with your Vim experience and you'll see that with time multiple cursors will seem totally useless to you.
The strength of this command is that the last change can be an action working on a character, a line or a whole file. For example, a change can be delimited beby the moment you enter insert mode and the moment you go back to normal mode.
All the challenge of the dot command is to learn how to make repeatable changes: it will come with groking vimgrokking Vim but the basic is to understand how to make your change in a repeatable way.
Because A; createcreates an atomic action so when you'll use . on another line, no matter where you are in the line you'll insert the semi colon at the end. Whereas when using $a; you split your change in two parts $a and the insertion of ; so if you use . it will insert the semi colon on the current position of the cursor.
Macros are another extremely important tool in vimVim since it allows you to record a sequence of keystrokes and repeat it as if you typed it again.
I'll use, as an example, your second use case:
- Now you can use the macro to repeat your edit. As you are on the right line to edit you can simply execute the macro with
@q. As we want to execute it two times twice you can use2@qand you'll get the following result:
NOTE 1 As you may have noticed, using Oea0ea at the beginning of the macro was really important. Indeed, if you had put your cursor at the end of the first word before recording the macro and executing it again your result would have been:
The final @q@q would have called the macro by itself instead of using 2@q; you'd just have used @q and all the work would have been done.
Here comes another trick that doesn't directly apply to your use case but can'tcan be really useful to edit a large number of line at the same time. Let's get this extract of CSS code:
For more details on the [range] parameter please see :h :range. I wontwon't detail it here, I'll simply remind that % represents the whole file, '<,'>''> represents the last selection, and 1,5 represents the lines 1 to 5 of the file.
This parameter defines the lines which will be treated by the global command. If no range is precisedspecified, then the global command will use % by default.
NOTE 1 An important point that took me sometimesome time to realizedrealize is that the normal command is an ex command which means that you can use it with the global command. That can be really powerful: let's say that I want to duplicate all the lines which contains echo, I don't need a macro or even the magic formula n.. I can simply use
global has an opposite command vglobal abbreviated v which works exactly like global exceptedexcept that the command will be applied on lines which doesn'tdon't matchesmatch the [pattern] parameter. This way if we apply
As you can imagine these examples are pretty simple and are just made to demonstrate that when you follow the Vim way you really rarely need several cursors. My adviseadvice would be when you encounter a situation where you think it would be useful, write it down and take some time later to find a better solution. 99% of the time you'll eventually find a faster/more efficient way to do it.
Also I will repeat myself one more time but I really encourage you to read Practical Vim ofby Drew Neil because this book is not about "How to do that or this in Vim" it is about "How to learn to think in the Vim way" which will allow you to built your own solution to your future problems in a good way.