Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs - two columns of text in one buffer (source column/comment column)

Tags:

emacs

I would like to use Emacs to edit two columns of text side by side in one buffer with one column for source and another for comments, something like this.

int main() {    | Comment line 1
   print...     | Comment line 2
}               | Comment line 3

Automatic width correction would be nice too. Is there any possibility?

like image 969
Jarek Avatar asked Dec 17 '22 07:12

Jarek


1 Answers

I believe two-column mode does what you want, though it's a little tricky to use.

Move your cursor to the point just before the | and type C-x 6 s, which should split into two buffers where you want. And when you're done type C-x 6 1.

like image 109
Trey Jackson Avatar answered May 03 '23 23:05

Trey Jackson