This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
ediff-split-window-function horizontal==vertical?
Using GNU Emacs 23.4.1. With M-x ediff-files
1-How to make the 2 files vertically beside each other. By default they are one top, one down. I want one left and one right.
2-How to scroll automatically to next difference?
To split the panes side-by-side:
(setq ediff-split-window-function 'split-window-horizontally
ediff-window-setup-function 'ediff-setup-windows-plain)
(You can explore ediff's settings using M-x customize-group RET ediff RET.)
n and p will take you to the next or previous diff chunk, respectively. Press ? to get the full menu, which includes handy keys to copy changes from buffer 1 to buffer 2 and vice versa.
Related
This question already has an answer here:
Changing the size of the menu from the "Buffers" item in the menu bar in emacs
(1 answer)
Closed 9 years ago.
When I pull down the emacs buffer menu, if I have a lot of buffers, I see only a subset of them listed. So, I then have to do List All Buffers. Is there a way to configure the Buffer Menu so that it will show all buffers? Xemacs always did that, but we no longer are able to use that.
Adjust buffers-menu-max-size:
(setq buffers-menu-max-size nil)
From the C-h v buffers-menu-max-size on my version of Emacs 24.3:
Maximum number of entries which may appear on the Buffers menu.
If this is 10, then only the ten most-recently-selected buffers are shown.
If this is nil, then all buffers are shown.
A large number or nil slows down menu responsiveness.
This question already has answers here:
Emacs: help me understand file/buffer management
(6 answers)
Closed 8 years ago.
After having typed C-x C-b there will a new window showing currently opened buffers... that is easy. But how can I switch to one of them using only my keyboard? Now I have to move my mouse an click on the one of my interest, and that looks stupid:(
Thanks!
It's a standard read-only buffer with some special bindings. Switch to the window first with C-x o, then you can browse buffers with n, p. Open one in the new window with RET. You can even search the buffer if desired.
Check ido mode. Actually similar questions have been asked quite a few time.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I more easily switch between buffers in Emacs?
GNU Emacs 24.1.1
Hello,
When I want to switch buffers I use the following C-x C-b if I have many buffers active. But I find it very inefficient.
And it will display a lists of open buffers in the next buffer (I don't like this in the next buffer). Normally I have 4 buffers open at the same time.
Using the above I will then have to put the cursor (C-o) to get focus in the buffer-list buffer, when scroll up or down to select the buffer I want.
Sometimes I use C-x-b if I don't have many active buffers. However, I always have many.
However, I am looking for something then will open up a small buffer with a list of buffers (the minimum needed - just enough to show all buffers), and will automatically have focus. I scroll to select the buffer I want. And it will appear in the buffer I had focus on before I open the list of buffers. The buffer-list will then disappear.
Does anyone know of anything like this to make switching buffers easier.
Many thanks for any advice,
Apart from ido-mode, good buffer switching solutions are:
Plain-old C-x b + icomplete-mode
ibuffer - just rebind C-x C-b to ibuffer to see it in action:
(global-set-key (kbd "C-x C-b") 'ibuffer)
Helm - an incremental narrowing and selection framework useful to find just about anything (buffers included).
Check ido-mode. C-x C-b is the old way.
The ido lets you interactively do things with buffers and files.
When I press ctrl+left-mouse-button in Emacs, I get the mouse buffer menu. This is my favourite way of switching buffers, but the list of buffers doesn't have to be too long before it re-organises the list into sub menus (fundamental, LISP, others etc...). I really hate this because I find it much harder to find the buffer I'm looking for.
My question is: How can I set the number of items in the mouse buffer menu that emacs will show before it breaks the menu into submenus? (I want to increase it, obviously!)
The following two variables give you some control over this:
mouse-buffer-menu-maxlen
mouse-buffer-menu-mode-mult
My interpretation is that the latter is the maximum number of buffers in a given major mode before that mode gets its own sub-menu, and the former is the maximum number of buffers allowed in any sub/menu before it is split into multiple menus.
setq as appropriate, or
M-x customize-group RET mouse RET
full code with details to add to .emacs file is below
also note that mouse-buffer-menu-mode-mult takes precedence
to evaluate the below and see effect immediately, highlight and type M-x eval-region or put cursor inside each () and type M-C-x
;; "ctrl - left click" buffer menu: increase number of items shown
;; set max length of this list. default 20. see next.
(setq mouse-buffer-menu-maxlen 30)
;; set # buffer in a mode before grouping begins. takes precedence over previous
;; set to 1 to always group by mode. default 4
(setq mouse-buffer-menu-mode-mult 8)
How can I modify the way emacs picks which buffer to show after closing a buffer?
When I have multiple columns showing the same buffer, and then open another file in one of the buffers and then close the newly opened buffer, it doesn't switch back to the previous buffer, but to another buffer.
I'll try to explain with an example:
Start with a new emacs at *scratch*
C-x 2 (split into two columns)
C-x C-f 1 (find file 1)
C-x o (switch to other frame)
C-x b 1 (find file 1)
C-x C-f 2 (find file 2)
C-x k (kill buffer)
Now it switches to scratch but I would like it to show 1 in both windows again, is it possible to make emacs behave this way?
This may not be a direct answer to your question, but it might help.
Emacs manages its buffer list, including deciding which buffer gets displayed when you kill one (via kill-buffer). I haven't looked into how it's done, but the documentation is "out there". Lots of people have created custom buffer-stack management magic to change the way emacs does things, maybe some of them are based on bayesian analysis, or whatever. You can imagine the possibilities.
I've never looked into changing the way emacs manages its buffers. Instead I just bind other-window and switch-to-buffer to easy keystrokes (C-x o, C-x b) and I get really good at using them.
you could create a simple function for what you want: it should destroys all other windows, then split the window so that the current buffer is displayed in both. Luckily, emacs has functions that do exactly those things.
(defun cheeso-show-buffer-two-windows ()
"Close all other windows; then split, and show the current
buffer in both windows."
(interactive)
(delete-other-windows)
(split-window-vertically))
Bind that to a keystroke, and badda-bing, you're there. This is a vertical split - the windows are displayed in a vertical stack. If you want it horizontally split (the windows are side-by-side), then replace ... well, you know.
This also doesn't quite help directly, but Winner mode might help you get where you want to get.
Are you using tabbar-mode? I had the same problem and for me tabbar was the cause. Tabbar adds the function tabbar-buffer-kill-buffer-hook to kill-buffer-hook. You can remove it with (remove-hook 'kill-buffer-hook 'tabbar-buffer-kill-buffer-hook).
If you don't use tabbar try M-x describe-variable kill-buffer-hook. One of the functions in this list should be responsible for messing with your buffers.