Is possible to use mouse to move lines around?
Requirements & Clarification
- I do know keyboard solutions.
- normal mode
- cmdline commands,
- I want this feature -- mouse to move/duplicate/delete lines -- mainly for simple use (do not exceed one page). Here is the workflow, with example of copying vim 8.0 feature from Vim 8.0 is released - Laravel News
- between chrome and gvim
- copy in chrome
- back to gvim, paste
nn <buffer> <Tab> pto facilitate the workflow
- but here is the problem, some line are are whole line, some are not.
The result is like below
Asynchronous I/O support, channels Jobs Timers Partials Lambda and Closure Packages New style tests Window IDs
In this case, it is more sensible to move lines with mouse.
Of course I can
vG:g/^$/d to remove empty lines afterwards.
But I wonder is it possible to move/copy/delete lines with mouse, If possible, I'am also interested to how you community think about the api interface if to create a such plugin.
== Edit ==
step 1, selection
- double left click select current line
- with left mouse press, move mouse do selection.
this part is already doen if
though the behavior is a little different
- double click select current word
- triple click select current line
- the same as stated above
step 2, duplicate or move selected line.
- with above step, we are at visual mode.
- how to move the selected line?
Possible implementation of feature list
- right click to move selected lines at line that mouse click.
- with right mouse pressed, contiguously move select lines, maybe use hook on mouse event.
- right double click to duplicate selected line under line that mouse click.
In summary, how to achive this step 2, this is main point of my question. As for the mouse, someone may prefer use middle click or scrolled instead.