Using tabs in GNU Emacs 23

11,383

Solution 1

Emacs has this functionality built in. They are called buffers C-x C-f opens a new file of a name you provide. C-x b lets you change between buffers. C-x C-b lists all open buffers. C-x k closes the current buffer.

If you want multiple buffers in one window then C-x 2 splits the windows horizontally. C-x 3 will split it vertically. C-x 1 will close all the windows that are not the current one. C-x o cycles between open panes. &c.

GNU the organization that manages the code base for GNU Emacs has a wonderful tutorial

Note: the the above segment C- means while holding the <CTRL> key

post script: the ido library makes working with emacs in generally much easier.

Solution 2

You can already open multiple files in buffers. However, if you want a visual guide, then this is what you might want: http://emacswiki.org/emacs/TabBarMode

Caveat emptor: You might have to configure it a bit.

Share:
11,383
Zain Khan
Author by

Zain Khan

a Computer Science grad, wanna-be geek and a coffee lover

Updated on June 04, 2022

Comments

  • Zain Khan
    Zain Khan almost 2 years

    I have been looking into packages that would enable me to have tabs in my emacs editor. Would like to open multiple files in a single emacs window. Any help/link would be appreciated

  • Noufal Ibrahim
    Noufal Ibrahim about 12 years
    This answers the question but the emacs "way" is to use buffers along with one of the many navigation/selection bindings rather than tabs. Tabs are quite primitive compared to the buffer list anyway.
  • Mario
    Mario about 12 years
    You are, of course, correct. However, when faced with questions like this, I prefer to give the OP what they want, and let them figure out the madness of their ways themselves :-)
  • zellio
    zellio about 12 years
    @Mario - usually I agree with you. Answer the question asked, not just give the "Right Way (TM)" to do it. That being said, with something like Emacs, where in you can basically do anything you want ( as it's almost an OS in it's own right ) I think it can be forgiven.
  • Noufal Ibrahim
    Noufal Ibrahim about 12 years
    I disagree. The OP asks a question because of a mistaken assumption. Helping him along the wrong way (especially without a caveat) will cripple him.
  • Mario
    Mario about 12 years
    In my experience, this usually doesn't "cripple" people. At the worst, it will educate the person when they are annoyed. And as you said, alternatives where already provided, so there was a caveat emptor. Wrong forum to discuss this, anyway.
  • marcelocra
    marcelocra over 8 years
    To kill the current buffer you should use C-x k, not C-x C-k.