Is there a better way to switch between multiple windows in emacs gdb besides Cxo?

I use gdb-many-windows, which contains five windows to switch between them. Is there a shortcut that I can use to get to a specific window?

+7
source share
5 answers

Some people find WindMove more convenient than Cx o . It allows you to move between windows using the Shift + keys.

+4
source

You probably already know that Cx o will bring you to the next window. You can expand this to go to any arbitrary window with Cu <windowoffset> Cx o .

So, you can use Cu 2 Cx o to switch to the second window before your current one.

This wraps around the window list (so in your case of 5 windows you can do Cu 4 cx o to go back.

You can also use negative numbers to go back.

Finally, this requires a bit more customization, but Thomas's suggestion to use WindMove is very useful. It was not configured by default for me for any useful key binding. I add the following snippet to my (mac) .emacs file, whch allows me to switch windows using the control arrow (you need to reload .emacs by running or through "Mx load-file")

 (global-set-key (kbd "M-[ 5 d") 'windmove-left) (global-set-key (kbd "M-[ 5 c") 'windmove-right) (global-set-key (kbd "M-[ 5 a") 'windmove-up) (global-set-key (kbd "M-[ 5 b") 'windmove-down) 
+7
source

Perhaps useful links:

http://www.emacswiki.org/emacs/WindowNumberingMode

http://www.emacswiki.org/emacs/NumberedWindows

Edit: if you decide to use WindowNumberingMode (what I use), it may seem useful to you to attach buffers to windows (for example, Meta-1 switches to the buffer you expect, it switches, not just the first window). One way to commit is described in Emacs input buffers for windows (for cscope) .

+1
source

Window switching is so important in emacs, I have these settings (I still feel that they are not good enough). may help someone else.

 (global-set-key "\Mt" 'other-window) ;; was transpose words (global-set-key (kbd "Cx O") (lambda () (interactive) (other-window -1))) ;; back one (global-set-key (kbd "Cx Co") (lambda () (interactive) (other-window 2))) ;; forward t 
+1
source

I am using switch-window.el . You can select a window using the switch-window.

Image of switch window

0
source

All Articles