除了Cxo之外,emacs gdb中还有更好的方法在多个窗口之间切换吗?

发布于 2025-01-02 13:02:56 字数 63 浏览 0 评论 0原文

我正在使用 gdb-many-windows,它包含五个可以在之间切换的窗口。我可以使用快捷方式进入特定窗口吗?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

七月上 2025-01-09 13:02:56

您可能已经知道 Cx o 会将您带到下一个窗口。您可以使用 Cu扩展它以转到任意窗口。 Cx o 。

因此,您可以使用 Cu 2 Cx o 切换到当前窗口之前的第二个窗口。

这会环绕窗口列表(因此,在您有 5 个窗口的情况下,您可以执行 Cu 4 cx o 来返回一个。

您也可以使用负数来向后移动。

最后,它需要需要更多设置,但 Thomas 建议使用 WindMove 非常有用,默认情况下它没有配置任何有用的键绑定,我将以下代码片段添加到我的 (mac) .emacs 文件中,这让我可以通过控件切换窗口。 -箭(您需要通过启动或通过“Mx加载文件”重新加载.emacs)

(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)

You probably already know that C-x o gets you to the next window. You can extend this to go to any arbitrary window with C-u <windowoffset> C-x o.

So, you can use C-u 2 C-x o to switch to the second window ahead of your current one.

This wraps around the window list (so in your case of 5 windows you could do C-u 4 c-x o to go back one.

You can also use negative numbers as well to go backwards.

Lastly, it takes a bit more setup, but Thomas's suggestion to use WindMove is very useful. It wasn't configured by default for me to any useful key binding. I add the following snippet to my (mac) .emacs file, whch lets me switch windows via control-arrow (you will need to reload .emacs by starting up or via 'M-x 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)
半枫 2025-01-09 13:02:56

有些人发现 WindMoveCx o 更方便。它允许您使用 Shift + 箭头键在窗口之间导航。

Some people find WindMove more convenient than C-x o. It allows you to navigate between windows using Shift + arrow keys.

我是男神闪亮亮 2025-01-09 13:02:56

可能有用的链接:

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

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

编辑:如果您决定使用 WindowNumberingMode (这就是我使用的),您可能会发现将缓冲区固定到窗口很有用(例如, Meta-1 切换到您期望它切换到的缓冲区,而不仅仅是第一个窗口)。 将 Emacs 缓冲区固定到窗口(对于 cscope)。

Possibly useful links:

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

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

Edit: If you decide to use WindowNumberingMode (that's what I use) you might find it useful to pin buffers to windows (so, for instance, Meta-1 switches to the buffer you expect it to switch to, not just the first window). One way of pinning is described in Pin Emacs buffers to windows (for cscope).

深海夜未眠 2025-01-09 13:02:56

窗口切换在emacs中太重要了,我有这些设置。(还是觉得这些不够好)..
可能会帮助别人..

(global-set-key "\M-t" 'other-window)   ;; was transpose words
(global-set-key (kbd "C-x O") (lambda () (interactive) (other-window -1))) ;; back one
(global-set-key (kbd "C-x C-o") (lambda () (interactive) (other-window 2))) ;; forward t

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

(global-set-key "\M-t" 'other-window)   ;; was transpose words
(global-set-key (kbd "C-x O") (lambda () (interactive) (other-window -1))) ;; back one
(global-set-key (kbd "C-x C-o") (lambda () (interactive) (other-window 2))) ;; forward t
箹锭⒈辈孓 2025-01-09 13:02:56

我使用 switch-window.el
您可以使用“switch-window”以视觉方式选择窗口。

使用 switch-window 的图像

I use switch-window.el.
You can choose a window by visual way with 'switch-window'.

Image of using switch-window

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文