emacs tabs more vim-like - emacs

I'm currently trying emacs coming from vim. There is only one thing I desperately miss : tabs (in a GUI sense). I know TabBarMode but it doesn't keep the division of windows (with C-x 3 for example) from tab to tab while Vim does it. Is there any plugin for emacs that handle tabs in a more vim-like way?

Check out elscreen.

Emacs users know that tabs of all types are evil. :-) This must explain why this particularly useful metaphor has not caught fire among Emacs users. We're still waiting for a good, easy, implementation of GUI tabs, IMHO.
There is some promising (but young) development work (see Gtk tabs in emacs, new branch.) going on to do GTK tabs in Emacs. And you'll be happy to know that there is some competent enthusiasm currently at play in the wide new land of distributed Emacs development. However, even though Emacs development is proceeding at quite a pace (by comparison with recent history, it's breakneck!), it may be a while before GUI tabs 'just work.'

Related

IDE typing mode, emacs or vim [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
First of all, this is not a question on emacs vs vim. I use eclipse IDE for programming and I intend to continue using it. Having read many advantages of emacs and vim, especially the ability to do almost anything without using the mouse, I want to use a similar typing/editing scheme in my eclipse IDE; I'm aware that there are plugins available for eclipse to change the editing style to emacs or vim (emacs+, vrapper to name a few..).
Since I plan to continue using eclipse, the various advantages of vim and emacs like small memory foot print, vim/elisp scripting, availability on different platforms, configurablity etc are all lost. I want to import only the text editing scheme to eclipse and master it while keeping all of eclipse's features.
So, I would like to have an objective comparison of the benefits/disadvantages of only the text editing styles of emacs and vim.
EDIT: the reason I cannot move away from eclipse is because my company uses a customized version of eclipse which has specific plugins and dsls to interact with our product(hardware)
I cannot move away from eclipse because my company uses a customized version of eclipse
Please note that Vim is not an IDE (a search will bring up various discussions of this topic), therefore this dichotomy does not exist. You can very well use both Vim (for text editing) and a real IDE (for debugging, source code browsing, etc.), in parallel. A simple "launch current file in Vim" integration is quickly done, and you've already noted that there are several plugins that bring the basic key bindings (but not the huge customizability) into the IDE.
Also, it strikes me as odd that you have no preconception of Vim vs. Emacs yet. Most people breathe and live their key bindings so much that they desire them in their IDE, too; you just seem to "have heard" about those advantages, but haven't experienced them yet.
My advice: Use your IDE for work (as you have to, anyway), and try out Vim (as well as Emacs) in parallel, maybe for recreational tasks, a little scripting, blogging, whatever. You can then see for yourself whether you'll "get hooked" on one of them, or maybe the IDE will just work out fine for you. Also, time will tell whether a simple integration is sufficient, or whether you want something tight and deep like the Eclim project.
I can only tell something about vim, I have used emacs once in a while, but it doesn't seem to be compatible with me. Although I really like scheme which is a lisp dialect. Vimscript is a horror to program in, but it is possible.
The main feature vim offers is that it adds structure to text beyond the syntax of your language. You can manoeuvre, edit and transform your text with vim's movements. These are at the heart of vim and have to be learned well. This in combination of modes, makes vim a powerful tool for text editing.
On the other hand, for code editing, vim needs some modifications to be useful. You will a considerable amount of configuration. Most people keep their vim configuration in a fire and bullet-proof safe, so they will not lose their painfully built stack of options, plugins and other configurational paraphernalia. That is including me. A vimrc is quite personal. Emacs is easier to configure. I could pick it up much faster.
You have to learn a tremendous amount of knowledge to even be able to use it. Emacs is much easier, you can use it at once. My first encounter with vim was being not be able to leave the damn program, whatever I did. My second encounter, was carefully hitting i and the type some text and quickly hit :wq. But somewhere later I suddenly wanted to tame it.
Vim has macro's, which make a lot of text transforming tasks fun. E.g. this removes al spaces at the end of a line, something I sometimes run to stop the nagging of pylint about spaces:
qs:g/ $/s///g<CR>#sq
You should read this as: record a macro in register s, replace globally all spaces at the end with nothing, apply macro in register s, stop recording. When hitting:
#s
This macro will run endlessly, until you are satisfied. I still want to find one, which stops after he hunted the last space. This makes vim fun, it is a little language with one letter commands. You can combine letters together:
4f,d$
This means find he 4th comma (,) and delete (d) the line from there till the end ($). That makes it quite attractive.
I would personally go for vim, but you have to try the editors out. They have different philosophies and one of those will bite you and the other will seem reasonable. I don't believe you will find many people, who uses both and mastered both. They are both usable as code editor.
I still have emacs on my wishlist, maybe I will swap.
I would suggest reading these answers as they contain a good amount of differences between the two (although a lot of the benefits mentioned don't matter for you). I strongly suggest just trying them out.
A big difference that you will notice is that Vim uses modes, which makes it have a high initial learning curve, while Emacs is modeless, and you can use it like a normal text editor (notepad), but with added functionality. And his is where your style/preference matters. I personally don't like holding control down to move around in Emacs, where in Vim, you escape to normal mode and use hjkl to move around.
This might be of interest:
https://github.com/senny/emacs-eclim
It's a frontend to eclipse, providing Emacs features alongside with Eclipse, not just to mimic Emacs-keys only.
Some screenshots here:
http://www.skybert.net/emacs/java/

Is there a .emacs file available to make its keybindings behave like any modern IDE?

I learned programming with GUI editors such as Notepad++, Gedit, Netbeans and so on, so I'm used to some keybindings common in almost all of these programs (and some others like LO Writer, etc).
Is there any place where I can find a .emacs file that makes it work like that, so I can have all its power without spending half of my life in learning its keybindings or configuring it?
You might try ErgoMacs which was built to modernize Emacs. I haven't tried it since when I found it I already had too many of my own keybindings to switch, but if I were starting over, I'm pretty sure I would use it.
cua-mode remaps emacs to use the key bindings that most other programs use. It is built in to emacs and you can enable it in your .emacs with:
(cua-mode t)
It depends a bit on what you mean. There are ways to make Emacs use keyboard shortcuts that are standard in Windows, as e.g. pointed out by ataylor. However, when you say you want it to behave more like an IDE, it seems that you're not only interested in text editing keybindings (such as, moving the point, copy and paste, marking a region, etc.), but specifically for the functionality offered by IDEs: compiling, management of code projects, deployment, code refactoring, etc.
But Emacs is not an IDE. It's a text editor. Okay, it really is a lisp interpreter based around a visual model of text buffers.
As such it can do many tasks that IDEs do, but out of the box, IDEs do many of the tasks mentioned above better because they are made for these tasks. Since Emacs is just a lisp interpreter, a lot of people have written extensions to its core functionality, in form of so called "modes". So, yes, by installing the right modes on top of a vanilla Emacs you can make it a pretty powerful tool that can compete with IDEs.
But that doesn't go without spending half of my life in learning its keybindings or configuring it. Well, half your life is a bit of a stretch. Emacs has a steep learning curve, that's true, but it's worth it -- because it is not an IDE. It's more than that.
If you're not willing to learn new stuff, than maybe you might want to take a moment and reconsider whether programming really is for you. Because the IT landscape changes very quickly all the time. Maybe in five years, Java is dead and no-one uses Eclipse any more. But you can be pretty sure of one thing: Emacs will still be around.
Okay, the last paragraph was total FUD, so ignore it. But seriously, learning new keybindings is not as hard as you think. And it doesn't take thaaat long either. You could re-configure and re-assign completely to your own liking in Emacs, but why not give the standard keybindings a chance?

Better control over where windows with cscope buffers in Emacs

Emacs is my editor of choice, and I use the cscope intergration xcscope.el provides. Recently I had a flirt with Vim. I decided to stay with Emacs, but one of the things I really liked in Vim was how I could control where my cscope windows should appear. Using cscope_maps.vim (http://cscope.sourceforge.net/cscope_maps.vim) I get shortcuts that let Vim open search results in the same buffer, a new horizontal or a new vertical split.
In Emacs a the cscope buffer just pops up in a window somewhere, according to some rules I don't know. My guess: A new window is opened if I have only one. If I have more, the one I've been away from for the longest time is used.
Pin Emacs buffers to windows (for cscope) is the only related topic I've found that helps a bit, but that doesn't make it near as flexible as the key bindings in Vim.
Anyone got a better cscope setup in Emacs than what xcscope.el provides? I don't know lisp, so I have no idea how hard it would be to make this work the way it does in Vim.
Emacs 24 (not yet released) changes radically how it is decided which buffers are displayed in which windows. In principle it should give you more fine-grained control. In any case, how you solve the problem for Emacs 24 will be different from how you solve it for older versions.
Consider filing an Emacs enhancement request to specifically get behavior more like what you had with Vim. To do that, use M-x report-emacs-bug.

What are the compelling reasons to upgrade to emacs 23.1?

I saw the the news that emacs 23.1 was released.
For a programmer, What are the big reasons to upgrade? I'm currently on 22.2.
None of the features listed really seem like must-haves for me. The most immediately interesting bit is that nXML is now integrated. I already have it though.
But I have to admit I don't know what is really behind "smarter minibuffer completion" or "per buffer text scaling".
Anyone have any tips or examples of what these things are?
For me, the biggest reason is the support for anti-aliased fonts. And the --daemon support is nice.
Emacs-fu has a nice write-up of some of the features.
M-x butterfly
No one said anything about multi-tty support? I have one long (LONG!) emacs session opened somewhere, and I ssh'ed into that machine remotely and use that particular emacs session (with all the temporary buffers, everything setup the way I liked, groups of buffers opened, etc.). The benefit of course, is that I don't need to worry about saving temporary buffers (you do use those as scratch pad, don't you?), etc. when switching machines (from school to home, for example).
Also, with multi-tty support, you can open emacs with emacsclient -nw to substitute your occasional needs for vi for quick terminal edits. emacsclient -nw will open even faster than vi, and you will have access to your opened emacs session as a bonus. (Before emacs 23, emacsclient cannot run from the terminal).
"Improved Unicode support (the internal character representation is now based on UTF-8)."
is a critical reason for me, but it no doubt depends on your work flow.
Some of the terms you are asking about were discussed in Set Emacs defaut font face per-buffer/mode and are also in the emacs wiki, e.g. http://www.emacswiki.org/emacs/SetFonts (under Changing Font Size - Buffer Text Resizing ).
While I was using the pre-releases, the most noticeable feature has been the improved font support. and some small things about smarter window splitting.
for me its font support and gnupg integration.
also its nice to read pdf's from within emacs.

Young people using Emacs?

I am a college student that has fallen in love with Emacs. I have used IDEs in the past, and although features like Intellisense made the switch to Emacs very hard, I now think that Emacs is much more powerful, and features like Intellisense can be pretty closely matched by various modes depending on language (and I am not referring to M-/). I am happily writing Elisp code for everything that I need that isn't provided by modes or by Emacs itself and I love the way that it adapts and molds to my needs.
However, I do think that its main disadvantage is the fact that it has a pretty steep learning curve and that most new programmers will not even begin to learn it out of many common misconceptions.
So, I want to know the opinions of young people (or any person who didn't start using Emacs before there were IDEs) that are Emacs users. Just to get some reassurance that Emacs is not dead within our Eclipse-loving generation =). (Opinions of users of any other highly extensible editor like Jedit are also welcome)
My "highly extensible editor" of choice is vim. Started using vi 10 years ago, at age 17, and I haven't really looked back. I like to stay away from my mouse as much as possible.
I rarely work in compiled languages these days, so the only thing I feel like I'm missing from an IDE is syntax-completion. Constantly switching to a browser to look up the order of arguments to various PHP functions gets a bit tedious.
PS: I don't want to start a vi/Emacs war here. I suspect that Emacs and vi[m] users have more in common with each other than either group has with IDErs.
I'm 62 and I've been using emacs for 21 years. I am capable of using vim in a pinch, but I really prefer emacs.
I used to use TECO a long time ago (in the 1970's) and I liked that one too.
First off, why do you care what other people think? It is clear that
Emacs has a vibrant community, as there are lots of extensions and
lots of people working on the core. There is plenty of support to be
had for it.
If you are "worried" that other editors are better, then you should
try those editors and make the decision yourself. Only you can know
what you like.
That said, I am young (23) and use Emacs. I have used it for almost
15 years. I have tried other editors, including Vim, Eclipse,
Netbeans, and Textmate. None of those editors work as well as Emacs
as far as I'm concerned, so I feel I made the right choice. I can't,
however, tell you which choice to make. You will have to figure it
out for yourself.
It is important to note that I am pretty "invested" in Emacs. I
maintain a lot of extensions, and have spent a lot of time
understanding the Emacs core... so if I switch editors, I am throwing
away a lot of time and experience. This could theoretically cloud my
judgment, but I don't think it does. Textmate works like Emacs, but
has fewer features. (I try not to use my mouse, so the eyecandy and
OS X integration don't buy me much.) Netbeans and Eclipse are nice
for managing Java projects, but on the rare occasion that I have to do
Java, I still find Emacs easier to use. I even find that writing Ant
files myself gets me closer to "where I want to be" than relying on
Eclipse's auto-builds. That leaves Vim, which is certainly
featureful, but is still a "lesser" Emacs. Emacs has all the features
of Vim -- if you want modal editing, you can just invoke Viper. The
only reason to use Vim is that you have already learned Vim, and you
can't stand the keybinding and editing model differences between Vim
and Viper. (No, Viper is not a Vim clone. It's Emacs with modal
editing.)
Anyway, JMHO. I think Emacs will serve you well throughout your
programming career. (Or any career that involves text. Emacs is
great for writing books... and email.)
When i was young i heard this:
A good hacker must be expert in 4 editors and 4 languages.
And have taken it to heart since then....
I routinely use vi(m), (x)emacs, eclipse , sed/awk/perl ( yeah .. they are text editors ).
IMHO, mastering a range of tools is essential. One should subject his brain to move
out of comfort zone every once in a while.
I now found it amazing that i have hundreds of key combinations at my fingertip , and rarely type key sequence of one into other.
I'm 21 and started using Emacs at 15, only moving away for Textmate/E in recent years. I personally can't stand IDEs, feeling they get in the way far more than they help. Give me a good straight-up text editor any day.
I'm 19, started using emacs last year, and I'm liking it. Even though I don't know how to use its "advanced" features yet, I'm comfortable with the fact that they exist and I could learn them when needed.
In my college, there shouldn't be much more than 5 students using Emacs or Vi, though.
Fear not, young programmer, and take courage from this Editor or IDE analysis. Powerful editors like Emacs will be around as long as there are language mavens. And IDE's will continue to serve the tool mavens. And each camp will continue to be amazed at how [un]productive the other is. ;-)
Well, I started using Emacs in college, and I'm only 30, so I think I count as part of the "Eclipse-loving generation".
I don't use it every day, but Emacs is certainly near the top of my tools list. (And much higher than Eclipse, I can tell you that.)
The first proper editor I used was Brief and then a number of IDE based ones before someone convinced me to try emacs (on Windows no less). I made the decision then that I was going to learn that one editor well and when I needed it to do something different I'd learn how to do it.
The real benefit of choosing one editor and sticking to it is consistency. Whatever language or task you're doing, if you're in your favourite editor, everything is easily remembered. Added to that the extensibility makes things possible that are often not on the slick IDEs.
Of course the downside is that your emacs session is a well crafted environment. If I don't have my .emacs loaded up it can seem like a foreign environment. Things work almost but not quite like I'm used to. Fortunately with DVCS systems my perfect environment is a git clone away.
I'm a university student age 19, but I started learning Emacs a good 2-3 years ago. I tried vi(m) for a bit, but I couldn't stand the modal editing model.
Prior to my introduction to Emacs, I was using Gedit and nano to do all my coding.
If you go to most grad schools, you will find your share of UNIX hackers who stick with emacs, so it's definitely there.
I'm 28 and switched from vim to emacs a month or so ago. I learnt a bit of emacs while learning lisp. I switched from vim because having compiler / debugger / shell integration made a lot of sense to me and I like the idea of the extensibility / customization.
I've got a few die-hard eclipse / intellij people I work with that are young and are rubbing their chins while thinking about making the switch. The buffer philosophy was almost enough to sell one person who was sick of tabs in IDEs.
It's not so much about age I don't think - those that are considering emacs are the ones that are forward thinking enough to realize that is has powerful enough features / ideas that the learning curve is / might be worth it.
I'm 22 year old emacs user and I cry whenever I have to leave it to do something on other IDEs.
I'm 21 and I use vim. It's a real step up from the other programming editors I had been using, and I would recommend anyone else in computer science courses to try it out.
I'm 23 and emacs was taught in our Operating Systems course as the "C editor you should use." I used it for the course, but have moved on to other IDEs that better suit my workflow and day to day development environment.
Edit Because my original post was not altogether helpful.
I used emacs through a command terminal inside of PuTTY and that is my extent of using it. I didn't mind it as an editor and got good enough with the shortcuts to be quite productive. I haven't really explored the emacs editor anymore than that because I was already using eclipse and really liked it.
Now, I use eclipse day to day because it is an extensible language that I have to develop with Java, ActionScript, JavaScript, PHP, CSS, HTML, and even Scheme. I also have a custom eclipse extension that I'm perfecting that helps me be more productive in my full time niche (WordPress development). Eclipse provides FTP and SSH services and I've been familiar with the interface for longer than any other IDE, and that is why I use it.
I was born in 1970*, but came (back) to programming about 6 years ago, starting with Visual Basic 6 (ay-yi-yi!). A co-worker would hard-code all his Perl in a text-editor (INCLUDING forms), which boggled my mind, but did not entrance. Slowly, I started using humble MS notepad for... notes while on the phone, open tasks throughout the day, etc. And slowly, I started wanting more. A number of other factors (desire to work closer to regexes, old desire to learn LISP [I came of age in the 80s, if you know what I mean]) lead me through a couple of editors, and finally to Emacs.
Now, I get frustrated in IDEs that I can't key-navigate and tweak to my heart's content.
*okay, so I may no longer be a "young people" -- but when I started using Emacs I was in my early-mid 30s, and identified as such.
I'm 26 and I'm using VIM for several years now for C++ development. All my team mates use either VIM or Emacs (50% vs 50%, we have great flames from time to time), our lead is also using VIM. It's a best choice for us on Solaris.
However for large MS APIs like DirectX I use VS... its sometimes pain to switch but it's much easier to tackle this kind of monster :)
I barely step out of my VIM these days and on those applications where I find myself forced into an IDE, I quickly remember why. I have become so accustomed to the VIM hotkeys for selection, replacement, folding, etc. that my productivity gets floored.
Like others, I rarely work in compiled languages anymore, so I've setup shortcuts that run my Perl/PHP paste the interpreters to find syntax errors. In some cases, I've even set up VIM to run available unit tests through the same interface. It's also very easy to alt-tab back to a browser (preferably on another monitor) and hit "Control-R" for a refresh, all without touching the mouse.
I'm 21 and I use vim for now 3 or 4 years...
I once tried emacs when one of my teacher told me it was better than Vim...but I prefered my workflow with vim...
I tried to use emacs last week because I had problem indenting html files...But my teamate lost me when he started talking about key combination or something like that. My guess is that vim or emacs are two great editor...It's better than most of the IDE I know.
Thumbs up to everyone.
I'm 20 and I started using Emacs last summer when I have to code c++ on linux, and Emacs was the only editor I can stand on openSUSE (Kate is horrible, horrible! - especially my work machine is kinda slow). Then I was won over; there is really nothing better in the world for a mouse-hater. Now I use emacs (yeah on Windows...) for all kind of thing including doing file operations with dired and playing tetris ;)
That being said I still code c# in Visual Studio (occasion switch to emacs for major refactoring and boilerplate work, which is much^100 easier in emacs). IF emacs has intellisense (that works) then I'll dump the text editor in VS studio (I will still use the GUI designer though, nothing replaces that); as of now, having to look up classes is too much a pain for me to code c#.NET in emacs.
I'm a 19 year old college student who uses Emacs - I started using it about a year ago and haven't looked back.
I've only been using emacs for about 10 years now. At one point I took a decided turn to learn it (and vi) to be more comfortable editing directly on servers.
When it comes to writing code quickly and with little red flags when the syntax is wrong in realtime, using an IDE is like wearing gloves when handling thorny plants: you don't have to be as careful. (It's also like using a word processor with automatic spelling fixes and grammar checks compared to using, well, emacs for writing.)
So, I mostly use Eclipse/Xcode/other-required-IDE except when it comes to quick changes, direct edits on a server, or other remote/fast editing scenarios.
What I haven't done is looked around to see if there are any good modes for emacs that allow it to provide such quick editing help as other IDEs (though, the default modes do help quite a bit, anyway -- this isn't raw text editing, really).
I also had a pleasant surprise recently when I realized much of the Mac OS UI can use emacs commands in a similar way to how unix command line editing can be done with emacs commands. How cool is that?
I am under 30 and I use emacs.
Currently, I has to interface with computer through software speech recognition.
Nothing beats emacs because various commands are easy to program for recognition and create aliases.
now, it took me some time to get comfortable with programming in elisp, but I think benefit was worth it. I have tried using eclipse, but there is something about emacs, particularly extensibility, that it's hard to replace.
Mostly I use gedit. Simple and sweet. I'm 20 and always hated IDEs (I got my start with Netbeans in high school).
Emacs is all right; it doesn't quite do everything I like jEdit to do, but I'm not interested in spending time writing macros and plug-ins for my editor - I like getting stuff done instead. If I needed my editor to do something that different, I'd get another editor or install someone else's plugin.
I've used jEdit, Visual Studio, notepad++, TextWrangler. I abhor VIM.
Ironic....
I use emacs full-time now. Several months after the above answer I was doing a lot of remote logins into Linux and nano got too constricting. And, yes, I've spent time writing macros and plug-ins for emacs. jEdit is still pretty good, but emacs is quite better. Still don't use vim(yet?).
I'm 17 and I started using Emacs when I was 14, and VIM when I was 15. I use Emacs for SLIME and ERC mostly now, preferring GVim for editing files and such.
Each time I approached a respected guru type about Emacs, they would warn me away. Most of them didn't like it, either. I took that as a clue.
OTOH, I was interested in TECO a long time ago (now you know my age), and I hear Emacs grew out of that. So, I still wonder...
You can have my copies of Eclipse, NetBeans and Visual Studio when you pry them from my cold, dead hands!
I tried to learn how to use Emacs when I started my degree, but I eventually gave up. Part of that is because I have a poor memory, and its keyboard shortcuts are unconventional compared to what I am use to.
I do almost all my coding in TextMate (which has been dubbed the Emacs of Macs). If I'm in a command-line environment then ViM does the trick.
I code J2me in Windows, where my company doesn't impose me on certain IDE. And guess what, I return to my Old friend, Emacs...
I am 31 now, and I first learning emacs ca 23. But, the situation makes me change IDE alots : Netbeans, VS.NET, Eclipse, etc.
You know, Emacs still beat other, in some perspective :)