I am using emacs I find that sometimes I have 2 files separated into 2 windows.
For example: I open 1 file using C-x C-f file1.c RET
and I split the frame into two windows: C-x 3
I then open another file C-x C-f file2.c RET
So I have 2 files:
window 1 (left) file1.c
window 2 (right) file2.c
I am wondering if there is any key combination to swap the files over? Normally I like to work on the left window when I have 2 window. I know I can easily do C-x oto move the cursor to the right window.
However, I am just wondering if I can swap the files so that file2.c
is in the left window and file1.c
is in the right window?
When Emacs has multiple windows, each window has a chosen buffer which is displayed there, but at any time only one of the windows is selected and its chosen buffer is the selected buffer. Each window's mode line displays the name of the buffer that the window is displaying (see section Multiple Windows).
Switching between files is much more comfortable within a single emacs session. Much better to use the multiple buffer feature of emacs. If you are editing the first file and want to start editing the second file, simply use the hot key C-x C-f or the menu selection File->Open File to start the second file.
You can split a window horizontally or vertically by clicking C-Mouse-2 in the mode line or the scroll bar.
This is because Emacs tracks buffer positions using that data type. For typical 64-bit machines, this maximum buffer size is 2^{61} - 2 bytes, or about 2 EiB. For typical 32-bit machines, the maximum is usually 2^{29} - 2 bytes, or about 512 MiB.
I use buffer-move for this. Now if you are working on the buffer on the left side, calling 'buf-move-right' will swap it with the one on the right. I guess this is what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With