Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emacs efficient buffer switching across dual monitors

Tags:

emacs

just switched from single to dual monitors

have managed to utilise both screens with emacs by using C-x 5 f to open a file in a buffer in a new frame, i can drag that frame on to the 2nd monitor and enjoy my extra real-estate

Prob I now have is how to efficiently switch between buffers in different frames

I'm used to using C-x o to switch between buffers in a split frame on a single monitor but this doesn't work for multiple frames

Having to use the more cumbersome C-x 5 b <buf-name> which is painful in comparison

Anyone have any top-tips on how to make buffer switching more efficient across dual monitors?

Ideally I would like to cycle across all buffers using a single simple keyboard shortcut regardless of frames

like image 989
bph Avatar asked Oct 24 '12 14:10

bph


3 Answers

I'd expect C-x 5 o to switch to the other frame, tho I don't have such a dual-screen setup to verify.

like image 122
Stefan Avatar answered Nov 16 '22 04:11

Stefan


With separate frames, I use the following to get mac osx style "same-app" switching with cmd-backtick. If you're on linux / windows you could do the same thing with alt-tilda:

(defined-key global-map (kbd "M-`") 'other-frame)

I like this because it keeps the action of switching frames separate from switching buffers. With multiple screens, it's usually some kind of context switch when you want to change which one has focus.

like image 37
spike Avatar answered Nov 16 '22 02:11

spike


Turning my comment above into an answer as it seems to be what the OP is after:

(defun other-window-visible ()
  (interactive)
  (other-window 0 'visible))
(global-set-key "\C-xo" 'other-window-visible)
like image 24
jtahlborn Avatar answered Nov 16 '22 04:11

jtahlborn