Skip to main content
3 of 3
Add further explanation.
tomasyany
  • 464
  • 1
  • 4
  • 9

Multiple cursors at desired location

I'm using vim-multiple-cursors plugin.

I would like to put cursors exactly where I want. For example ([x] are the cursor positions):

Lorem ipsum dolor sit amet[1], consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna[2] aliqua. 

In Sublime Text I would normally put the first cursor, then go to the next position with the arrows keys and put the second one.

Is there something similar in VIM? With this plugin or another.

EDIT

Following a comment, my interest in doing so appeared when trying to write
\section[My first section in this book]{My first section in this book}
in a .tex file. My first reaction was to write \section[]{} and then put two cursors in order to write the same thing inside the [] and {}.

Other example would be to add _someStuff after several different variables names. For example, turn this:

variable1 = 2 my_variable2 = 12 var3 = 14 

into this:

variable1_someStuff = 2 my_variable2_someStuff = 12 var3_someStuff = 14 

With multiple cursors I can do by selecting a column cursor and then going to the end of the word, then inserting, etc. But I guess I would be easy to choose exactly where I want the cursors to be.

tomasyany
  • 464
  • 1
  • 4
  • 9