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

I would like to use Emacs to edit two columns of text next to each other in the same buffer with one column for the source and the other for comments, something like this.

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

Automatic width correction will also be enjoyable. Is there a possibility?

+4
source share
2 answers

I believe that dual-column mode does what you want, although it's a little difficult to use.

Move the cursor to the point immediately before | and enter Cx 6 s , which should be split into two buffers where you want. And when you're done, type Cx 6 1 .

+6
source

The comment-dwim ( M-; ) command should do what you want.

+6
source

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


All Articles