On 05/08/12 15:12, Asis Hallab wrote:
> Dear Vimers,
>
> I just watched a screencast about /Submile Text 2/, a much buzzed about
> new text editor.
> It has a very neat feature called *multiple cursors*, where the user
> just selects different positions in the current buffer and every editing
> done is applied to those multiple cursor positions.
>
http://www.youtube.com/watch?v=o5bPRhFHEz0
>
> In some cases I am convinced this feature is easier and quicker to use
> than macros.
> In a way the visual block mode does what multiple cursors do. Only they
> do more..
>
> I have to say, there is already an emacs plugin for multiple cursor support:
>
https://github.com/emacsmirror/multiple-cursors
>
> So now my question:
> Could this be implemented as a plugin for vim?
> Could that be written in VimL or needed to be compiled into Vim itself?
>
> Looking forward to your ideas.
>
> Cheers!
> Asis
>
Vim does not apply the same changes implicitly to more than one
location. Implementing it in vimscript might be possible, but probably
inefficient (I mean, you may have to wait a measurable time before you
see each character), especially if your "multiple cursors" are in one
window but farther away from each other than the window height. I
imagine that one would either map every key in Insert mode, or intercept
all keys are they are typed.
Concerning implementation in C code, I believe that it would be both
hard to code in a bugfree manner on top of the existing Vim source, and
contrary to the "Vim philosophy" � but I'm no prophet about the latter.
The nearest thing to multiple cursors that I can imagine which is easy
to do, would be to have your "several locations" (in one file or in
several files) open in parallel split windows in a single tab. Vim
remembers the cursor position for each window (even for two or more
windows on a single file) and switching windows would bring you from one
location to the next. After typing some text at the first location, you
could "yank" it, then change windows (e.g. with Ctrl-W w) and "put" it
at the next location (you know, don't you, that yank and put are Vim
terminology for copy and paste respectively?). See also :help
'scrollbind' about scrolling two (or more) windows in parallel. Oh, and
see :help q about remembering keyboard actions (including cursor moves)
to have Vim replay them later.
Oh, and if you want to make Vim "more like emacs", I think you will find
extremely little enthusiasm in these groups. Just an opinion, worth no
more than my 0.02 �.
Best regards,
Tony.
--
ARTHUR: I did say sorry about the `old woman,' but from the behind you
looked--
DENNIS: What I object to is you automatically treat me like an inferior!
ARTHUR: Well, I AM king...
The Quest for the Holy Grail (Monty
Python)