Emacs 上的选项卡式窗口

发布于 2024-09-19 13:31:37 字数 402 浏览 5 评论 0原文

我正在尝试像 vim 一样在窗口中获取多个选项卡。在 vim 中,选项卡不与缓冲区绑定,您可以有多个选项卡,每个选项卡中都有多个分割和缓冲区。到目前为止我发现的是:

  • tabbar:显示所有选项卡。
  • winring:不在窗口中显示选项卡,并且使用起来很笨拙(必须先命名每个选项卡)。这是最接近我想要的。

如果这可能的话,有人有什么想法吗? Tabs + emacs 很难搜索;我发现的大部分内容都是关于空格与制表符的讨论:)

更新: 这张照片展示了我想要的东西。

在此处输入图像描述

多个选项卡,每个选项卡上有一堆分割缓冲区。

I'm trying to get multiple tabs in windows like vim does it. In vim tabs aren't tied to buffers and you can have multiple tabs each with multiple splits and buffers in them. What I've found so far is:

  • tabbar: shows all tabs.
  • winring: doesn't show tabs in the window and is clunky to use (have to name each tab first). This is the closest to what I want.

Does anyone have any ideas if this is possible? Tabs + emacs is hard to search for; most of what I find are discussions of spaces vs tabs :)

Update:
This pic shows the kind of thing I want.

enter image description here

Multiple tabs and a bunch of split buffers on each tab.

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

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

发布评论

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

评论(3

吾家有女初长成 2024-09-26 13:31:37

我使用名为 ElScreen 的东西,它允许我做你正在寻找的事情。实际上,当我决定开始使用 Emacs 时,我也希望 VIM 提供此功能。

以下是我用于 ElScreen 的代码,我什至使用了与您在 VIM 中使用的相同类型的键绑定。 Control-C,后跟 tabe 或 tabd 以模拟 VIM 中的 :tabe:tabd

要迭代下一个屏幕或本例中的选项卡,我使用 Control Meta _Control +

;; ---------------------------------------
;; load elscreen
;; ---------------------------------------
(load "elscreen" "ElScreen" t)

;; F9 creates a new elscreen, shift-F9 kills it
(global-set-key (kbd "C-c t a b e") 'elscreen-create)
(global-set-key (kbd "C-c t a b d") 'elscreen-kill)

;; Windowskey+PgUP/PgDown switches between elscreens
(global-set-key (kbd "C-M-_") 'elscreen-previous)
(global-set-key (kbd "C-M-+") 'elscreen-next)

以下是正在运行的选项卡设置的示例:

第一个屏幕。

alt text

第二个屏幕:

alt text

您可以在选项卡中使用 Cx3Cx2 分割缓冲区:)

I use something called ElScreen, which allows me to do what you are looking for. I actually also wanted this feature from VIM as well when I decided to start using Emacs.

The following is the code that I use for ElScreen, I even used the same type of keybindings as you would use in VIM. Control-C, followed by tabe or tabd to emulate the :tabe or :tabd in VIM.

To iterate through the next screen, or tab in this case, I use Control Meta _ and Control Meta +.

;; ---------------------------------------
;; load elscreen
;; ---------------------------------------
(load "elscreen" "ElScreen" t)

;; F9 creates a new elscreen, shift-F9 kills it
(global-set-key (kbd "C-c t a b e") 'elscreen-create)
(global-set-key (kbd "C-c t a b d") 'elscreen-kill)

;; Windowskey+PgUP/PgDown switches between elscreens
(global-set-key (kbd "C-M-_") 'elscreen-previous)
(global-set-key (kbd "C-M-+") 'elscreen-next)

Here's an example of the tab setup in action:

First Screen.

alt text

Second Screen:

alt text

You can have split buffers using C-x3 and C-x2 in a tab :)

彩扇题诗 2024-09-26 13:31:37

tabbar 是我认为迄今为止最受欢迎的软件包,但仅显示与您正在编辑的模式相同的缓冲区的选项卡(例如,如果您在 python 模式下处理文件,它仅显示所有 python 模式缓冲区的选项卡)。无论如何,这是默认行为;我很确定如果您愿意的话可以自定义它。但我的印象是,在 Emacs 中管理多个缓冲区的一种流行方法是使用 ibufferido 模式。例如,我的 .emacs 自定义包括

(require 'ido)
(ido-mode t)
(global-set-key "\C-x\C-b" 'ibuffer)

tabbar is by far the most popular package I think, but only shows tabs for buffers with the same mode you're editing (for instance, if you're working in a file in python-mode, it'll show tabs for all python-mode buffers only). That's the default behavior anyway; I'm pretty sure you could customize that if you wanted to. But my impression is that a popular way to manage multiple buffers in Emacs is with ibuffer and ido-mode. For instance, my .emacs customizations include

(require 'ido)
(ido-mode t)
(global-set-key "\C-x\C-b" 'ibuffer)
圈圈圆圆圈圈 2024-09-26 13:31:37

您可以执行 Cx 4 c 来克隆缓冲区:创建一个间接缓冲区,它是当前缓冲区的孪生副本。它允许您在不同的窗口中启用不同的主要模式来显示相同​​的缓冲区。

然后使用 tabbar 例如,您可以让不同的选项卡以不同的模式显示相同的缓冲区。

You can do C-x 4 c to clone a buffer : create an indirect buffer that is a twin copy of the current buffer. It allows you to show the same buffer with different major-mode enabled in different windows.

Then with tabbar you can have different tabs showing the same buffer in different modes for example.

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