Tabbed windows on Emacs

后端 未结 3 561
花落未央
花落未央 2021-01-30 14:01

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. W

3条回答
  •  生来不讨喜
    2021-01-30 14:29

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

提交回复
热议问题