How can I mirror editing actions in multiple buffers in Emacs?

I have two buffers open side by side in Emacs. When I delete (or modify) lines in the first file, I would like the second file to receive the same commands / cursor position. Is it possible?

+4
source share
1 answer

The closest thing I know about what you described is a multiple-cursors package, which is pretty cool, but it only implements multiple cursors in one buffer. Therefore, I suggest that you could:

  • Add one of the contents of the buffer to another;
  • Create multiple cursors using the package mentioned.
  • Split windows;
  • Edit
  • Move the contents of the added buffer back to the original location.

With what I suspect would be a significant hack, it would be possible to extend multiple-cursors to handle multiple buffers, but I think this will open a huge can of worms. What if two buffers are in different modes, and you enter a key sequence that is associated with different commands that perform different things?

+1
source

Source: https://habr.com/ru/post/1435571/


All Articles