Search code examples
emacsselectionhighlight

How can I select or highlight a block in Emacs?


I want to select or highlight a block in Emacs without using the mouse, but doing it from the keyboard like Vim's visual mode. What is the easiest way to do this from a keyboard?


Solution

  • Take a look at region-rectangle in Emacs.

    In short, you start selection like usual with Control-Space, then kill region with Control-x r k and paste (or yank) killed block with Control-x r y.