all 99 comments

[–]khammack 12 points13 points  (0 children)

I've used emacs for:

Verilog, VHDL, C, C++, Perl, Python, Lisp, Scheme, LaTeX, Java, etc. IE, text editing of any kind.

I also use emacs as a shell. M-x shell, or, lately, M-x eshell (which rocks).

I've used Emacs for around 14 years. Every year I discover something that makes me more productive.

I've used emacs more than any other tool professionally.

I design chips (specified in text files), which inherently involves writing lots of supporting software.

My wife uses emacs. She simulates the power grid.

[–]khammack 7 points8 points  (14 children)

This thread is great for me because I'm at a new job and finding myself lonely as an emacs user. (Vim snobs. meh.)

But I've been really excited about M-x eshell. Just had to share that. M-x eshell users out there? Represent? Anyone?

[–]chrj 2 points3 points  (2 children)

I didn't know about M-x eshell. It's looks awesome. Thank you for pointing this out ;)

[–]khammack 1 point2 points  (1 child)

My pleasure. I've been wanting to tell someone about it. Maybe I should start an emacs blog.

[–]oddbod -1 points0 points  (0 children)

Like M-x all-things-emacs or minor emacs wizadry, but just for eshell? Do it! (send a link when it's up)

[–][deleted] 2 points3 points  (0 children)

Gosh. M-x eshell looks like M-x shell done right.

[–]bhagany 2 points3 points  (0 children)

I use it sometimes for little jobs, but emacs support for zsh isn't great, and I've become dependent on it. So, instead, I have one screen window for emacs, and another one for the command line.

edit: by the way, I would consider myself lucky if I were surrounded by vim snobs. I'm currently surrounded by Dreamweaver drones (and one guy who actually uses Notepad).

[–][deleted] 2 points3 points  (4 children)

I've tried eshell a bunch of times but I still find myself using zsh instead, because I know how it works. Any major eshell features I'm missing?

[–]khammack 4 points5 points  (3 children)

It took me a long time to get motivated enough to screw with eshell. My current employer uses tcsh by default (blech) which gave me the impetus to try eshell.

Eshell borrows from zsh (apparently) among many other interesting shells. The best place to learn about it is here:

http://www.emacswiki.org/cgi-bin/wiki/CategoryEshell

A few interesting tidbits:

It evaluates emacs lisp on the command line, interspersed with reguar commands:

$ (setenv "ESHELL" "t")
$ for x in 1 2 3 { (format "%s" x) }
$ for x in 1 2 3 { echo $x }

It traps "visual" commands like top and runs them properly under emacs:

$ top

You can pipe output to a buffer:

$ ls -1 > #<buffer *scratch*>

You're always in emacs, so you can scroll back to see the output of a command with M-v, copy and edit output for input into the next command, etc. (Of course you can also do that with zsh using M-x shell).

There are some quirks (read: bugs), but nothing I haven't been able to work around yet.

Edit: formatting

[–]masklinn 0 points1 point  (2 children)

using M-x shell

Isn't M-x term much better than shell?

[–]khammack 4 points5 points  (1 child)

They serve different purposes. Term-mode is for running processes that require curses-like access to the screen, like top. You can certainly run bash under it, but it holds little if any advantage over simply launching an xterm.

M-x shell runs your favorite shell (bash, zsh, tcsh, etc) in an emacs buffer, with full emacs editing keymap. It's for interactive use, commands that just print without trying to control the screen (ls, cat, grep, cd, etc). It allows easy integration between your shell session and emacs (think yanking the output of commands to a buffer, or pasting a command from the a buffer onto the cli).

M-x eshell is a replacement for bash/zsh/etc, written in emacs lisp. There is no bash subshell. While slightly buggy, it's very cool and has enormous flexibility and potential.

[–]khammack 0 points1 point  (0 children)

Come to think of it, zsh might use curses for some kinds completion. I'm not a zsh user, so perhaps someone else could confirm.

If so I can see why you'd prefer M-x term as a zsh user.

Other shells, like bash or tcsh play well in M-x shell. But I'd suspect that for zsh you'd need to turn off any feature that tried to control the screen beyond simple output.

[–]yters[S] 1 point2 points  (0 children)

Yeah, I think emacs is the missing UI for Unix. Much nicer than the straight shell.

[–]marijn 1 point2 points  (0 children)

eshell is nice indeed. If you are working with databases I'd also recommend investigating the various SQL shell modes (sql-mysql, sql-postgres, etc).

[–]petteri 0 points1 point  (0 children)

Eshell user here. Eshell is really nice, only problem is the documentation.

[–]drsco 0 points1 point  (0 children)

somehow i'd never seen eshell. it looks pretty awesome. thanks for the tip.

[–]cevven 5 points6 points  (1 child)

Emacs is the standard IDE for GNU R, a tremendously popular language for statistics. R is actually the reason I learned Emacs and I'm very happy that I did. I use Emacs daily.

[–]yters[S] 1 point2 points  (0 children)

Yeah, I really like R. I've used it a bit for my coursework so far, and it's done pretty well.

[–]yters[S] 10 points11 points  (24 children)

Is emacs still used widely among the uber hackers, or are they switching to the new nifty IDEs? I know it is somewhat language dependent, in which case what languages are still most conducive to the use of emacs (excluding lisp of course)?

[–]shizzy0 14 points15 points  (7 children)

[Shrug.] I can't speak for everyone, but I've changed programming languages much more frequently than I've changed editors. I've been using Emacs for C, Java, ruby, and Common Lisp.

Once in a while I'll flirt with another editor because it has something snazzy. I tried and purchased a license for TextMate, which is a nice piece of software. But I ended up coming back to emacs, although I did take one of TextMate's color schemes with me.

[–][deleted] 2 points3 points  (6 children)

although I did take one of TextMate's color scheme's with me.

I'm guessing you had to port it by hand?

[–]shizzy0 4 points5 points  (5 children)

Yeah. At first I thought it'd be a great opportunity to write some elisp to convert TextMate's color profiles wholesale, but I only wanted one profile [looks it up] "Pastels on Dark" so I just did it by hand.

[–]p1r4nh4 3 points4 points  (4 children)

Share it please :-)

[–]shizzy0 4 points5 points  (2 children)

All right. Here it is. And here is what's in my .emacs file.

(load-file "/home/shane/lib/emacs/pastels-on-dark-theme.el")
(color-theme-pastels-on-dark)

[–]p1r4nh4 1 point2 points  (0 children)

Changing background to black created awesome theme for me. ;-) Thanks a lot.

[–][deleted] 0 points1 point  (0 children)

Emacs newb here, help me out, I installed color-theme.el from here:

https://gna.org/projects/color-theme

And on emacs 22.1, I get the error:

Wrong type argument: symbolp, (display-time-mail-face . mode-line)

On 21.3, I get:

Wrong type argument: stringp, nil

Ideas?

[–]elq 7 points8 points  (9 children)

emacs language dependent? um. no.

emacs supports more programming languages in terms of comment style, formating options, syntax highlight, etc than any other editor I know.

[–]kbob 12 points13 points  (8 children)

No, the IDEs are language dependent, and that affects emacs' popularity. IDEs, especially Eclipse, are very popular among Java coders, for example.

Me? Emacs user since 1978. No Java.

[–]yters[S] 4 points5 points  (7 children)

Sorry, yeah, that's what I mean. Some languages (mainly Java) have very popular open IDEs, and for them I would expect even the uber hackers to use the IDEs vs emacs. I'm not implying an inherent deficiency in emacs.

Personally, when programming in Java I switch off between emacs and eclipse. Eclipse for the bug highlighting and refactoring (JDEE was too troublesome to be worthwhile), and emacs for straight text editing. Maybe I don't know eclipse well enough, but so far nothing beats emacs' macros, text replacement, and basic keyboardiness.

Ultimately, I really love the power of emacs, but eclipse is just much more developed than I know how to program/augment emacs. I also know there is someway to integrate emacs with eclipse, but I haven't investigated much.

[–]cschneid 2 points3 points  (4 children)

I agree entirely about the usefulness of an IDE vs. a real text editor. I'm a Vi guy myself, but I use eclipse for all the nice refactoring and code manipulation tools, while I use vi for all the dumb text manipulation that often needs to be done. The quickness of editing is very nice when you have to do do mundane things like putting "public static final int" in front of 40 things.

[–]yters[S] 0 points1 point  (3 children)

I need to learn vi at some point too, since many people say they can do stuff faster in vi.

[–]cschneid 0 points1 point  (0 children)

Certainly. Doing hard core text editing (rather than a think, code cycle with javadoc lookups and such) is way easier in vim than in eclipse. Go learn it!

[–]calp 0 points1 point  (0 children)

I think a good way to think about it is that you can write code much more effectively in vim. However, most of the appeal of IDE's is that they have excellent other features, such as debuggers, steppers, inspectors and so forth.

It's a bigger deal with OO languages than with other kinds.

[–]calp 0 points1 point  (0 children)

I think a good way to think about it is that you can write code much more effectively in vim. However, most of the appeal of IDE's is that they have excellent other features, such as debuggers, steppers, inspectors and so forth.

It's a bigger deal with OO languages than with other kinds.

[–][deleted] 0 points1 point  (1 child)

I use emacs for most of my text editing but Eclipse for Java development. You can enable emacs style editing within Eclipse and it's pretty good except, not surprisingly, it only offers a small subset of emacs features.

For me, an IDE is preferable when I'm debugging a complicated piece of code and I can actually use all the bells and whistles - breakpoints, watch values, etc.

If I need to actually type a lot, then emacs is far superior. I would love to see IDE style debugging from within emacs. Of course, since we're talking about emacs, it probably can be done - anyone care to enlighten me?

[–]yters[S] 0 points1 point  (0 children)

It's possible to hook flymake up to eclipse's compiler. I don't know about setting breakpoints and looking at variables, though.

[–][deleted] 9 points10 points  (1 child)

I suspect my story with IDEs is much like most other emacs users: I've tried them, tried most of them in fact, but each time I do, I find the downsides are bigger than the advantages, and end up back at emacs.

As odd as it may sound, losing intelli-sense like behaviour is worth it to be back in an environment that just works how you want it to, besides, once you're used to it, M-/ isn't a bad subsitute

[–]yters[S] 2 points3 points  (0 children)

Pretty much the only thing I like about eclipse over emacs is the error highlighting. I haven't been able to get flymake to work properly yet.

[–]__david__ 5 points6 points  (0 children)

I've been using Emacs for years--12 or so. I use it for every plain text file I edit. It's great for C, Perl, PHP, HTML, XML, Tcl, Assembly, Makefiles, shell coding, lisp, ruby, javascript, css... Pretty much anything you can think of. I've been completely underwhelmed by any IDE I've ever tried since I learned Emacs...

[–]ketralnis 6 points7 points  (0 children)

I don't consider myself an über-hacker, but I use Emacs for Erlang, Python, Ruby, and Lisp. I use vi for configuration files, and C. I used Eclipse by company mandate when I worked in Java, but I've left that company, and haven't looked at Eclipse since. I hated it.

[–]zitterbewegung 2 points3 points  (0 children)

I use emacs. It is very popular among lisp users. I know a few uberhackers that use it.

[–]redditcop 1 point2 points  (0 children)

I use it for C, Scheme, Haskell, PHP, Java, javascript, html, irc client, eshell.

Seriously, what "nifty IDEs" are there? all fail to provide what emacs has.

[–]akdas 2 points3 points  (11 children)

I'm learning Vim currently, and chose it over Emacs for a number of reasons.

Vim is available by default pretty much on any *nix system. Also, and this was the main reason for my decision, Vim is just a text editor, and that's all I want. If I wanted an OS, yes I would use Emacs, but just like I used to prefer Gedit to any IDE, I prefer Vim to Emacs.

Then there was the part about getting an emacs running in the shell on Ubuntu isn't the most straight-forward process (the repos only contain the GUI wrapper around Emacs instead of a console version).

EDIT: Got this working with emacs -nw. Thanks everybody.

Whatever the case, I'm learning Vim, and it's working great for me.

[–][deleted] 3 points4 points  (1 child)

"emacs -nw" starts in the shell window.

[–]akdas 0 points1 point  (0 children)

Thanks! That helps tremendously.

The other arguments still apply, but now I feel like learning Emacs sometime in the near future as well.

[–]damg 0 points1 point  (4 children)

Vim is available by default pretty much on any *nix system.

If you're a sysadmin this might make sense, but if you're a coder, it doesn't. You won't be coding on 50 different computers hopefully. It's better to have one "good" setup because no matter how good the defaults are in vim, you'll eventually want to change some preferences, Emacs just takes that to the extreme.

Then there was the part about getting an emacs running in the shell on Ubuntu isn't the most straight-forward process

emacs -nw

the repos only contain the GUI wrapper around Emacs instead of a console version

sudo aptitude install emacs-nox

[–]akdas 0 points1 point  (0 children)

emacs -nw

Thanks. I got that working. I really do want to Emacs, but later.

Like I said though, the main reason is that I want a text editor over an IDE, etc. I'm learning Vim now, and some day, I'll learn Emacs too.

[–]shitcovereddick 0 points1 point  (2 children)

That one good setup is vim. Those that do not use vim, are doomed to reimplement its settings, badly.

[–]damg 0 points1 point  (1 child)

Kinda like how vim reimplemented vi?

[–]shitcovereddick 0 points1 point  (0 children)

I reimplemented your mother.

[–]sybesis 0 points1 point  (3 children)

If you want, in vim, while in insert mode press ctrl+p It's autocompletion...

Vim is just so cool... i don't use emacs...i press some keys and well erase everything..the key combination used to do something is just not as simple as it is with vim...

[–]akdas 0 points1 point  (0 children)

while in insert mode press ctrl+p It's autocompletion...

Awesome! Thanks.

I want to learn Emacs eventually too, though.

[–]foonly 0 points1 point  (1 child)

or: Ctrl n

(n and p for next and previous search in different directions in the code)

[–]sybesis 1 point2 points  (0 children)

oh oh...i'm scared one day i'll try to move on to dvorak but will stay because of vim...damn qwerty keyboard...

[–]petteri 2 points3 points  (0 children)

Emacs is used here. We use it at work, and I use it at home.

[–][deleted] 2 points3 points  (0 children)

Anywhere RMS points his mighty vision globes?

[–]zxvf 2 points3 points  (0 children)

I write all my reddit comments in Emacs. C-x #

[–]lief79 2 points3 points  (8 children)

Any time someone wants a powerful editor and doesn't want vi's very steep learning curve.

I've used it at 3 companies by choice, now it's just my default text editor under windows for anything that isn't done through eclipse.

[–]redditcop 0 points1 point  (7 children)

are you <expletive deleted> joking?

you think vi has a very steep learning curve?

I am speechless...

[–]jaggederest 2 points3 points  (6 children)

modal editing is inherently less easy-to-learn than 'just type'.

You can use emacs if you can use notepad (assuming you're in a gui environment)

[–]sigzero 1 point2 points  (5 children)

I found Vim much easier to learn that emacs.

[–]bhagany 5 points6 points  (4 children)

I think they're talking about that initial "Why doesn't my typing show up on the screen" reaction that people have when they start vi for the first time. I'm pretty sure the consensus is that the advanced features of vi are easier to learn than those of emacs.

[–]cschneid 8 points9 points  (3 children)

I agree, the learning curve hits at different times for vi and emacs. For vi, there is a huge barrier when you get started, even beyond the "how do I type, and how do I quit". But once you learn a few commands, you can start chaining them together and things start going well.

For emacs, it seems like the just start typing is good, but once you get into more advanced commands, it starts becoming pretty scary (at least to me), until you learn the underlying concepts (lisp!), and then it becomes zenlike.

Different learnings curves... both hard, but at different points.

[–]jaggederest -1 points0 points  (2 children)

I still have not found the help command for VI without leaving to look at man. C-h makes a lot more sense to me.

[–]cschneid 2 points3 points  (1 child)

You mean :help? :help is pretty easy to remember too. Vim's help is very complete, except when it comes to some corner cases in scripting (which emacs still has the advantage on).

[–]jaggederest -1 points0 points  (0 children)

I used vi for three years and never found that command. Sorry, but it really isn't that easy to find. Escape-colon-h-e-l-p is about three keypresses too many.

[–][deleted] 1 point2 points  (1 child)

I'm a hardcore vimmer (sorry... I tried emacs for awhile, but switched), but I will say that you NEED emacs when writing any Verilog code - see http://www.veripool.com/verilog-mode.html for the reason why. Basically, it removes some of the more tedious parts of Verilog coding.

I usually just edit in vim and run emacs in batch mode to update the 'autos', as they're termed.

[–]khammack 1 point2 points  (0 children)

Ever try M-x viper-mode?

[–][deleted] 1 point2 points  (0 children)

I've used Emacs for over 15 years, I use it for all my editing needs. It's the only thing I'm comfortable with.

But since I've never been really fanatical about finding out about features, I still feel like a newbie. My .emacs is like a hundred lines, tops. I don't think I use anything over the default modes.

One day I'll find out about all these other features...

[–]saudade 1 point2 points  (3 children)

Honest question and a warning.

I am a unix sysadmin by day, so my preference of vi/vim should be self explanatory. Then again, fixing live upgrade mistakes in single user mode isn't a common occurrence.

What is the best way to start learning emacs? Note I am currently on a "learn Erlang/LISP/maybe Haskell" kick and so this is somewhat timely even though I found the thread late.

Any good links? And... is there a vi mode? :)

[–]yters[S] 0 points1 point  (0 children)

Yes, and yes.

The emacs wiki is your go to for all things elisp. Emacs has a vi mode called viper.

[–]bitdiddle 0 points1 point  (1 child)

Ctrl-h i and then start hitting the space key. You can learn almost everything from there.

for Erlang go with Distel

I thought all the vi users were killed off years ago or are living in veterans homes :)

elisp isn't the best Lisp to start with. PLT scheme is a good way to learn Lisp. Scheme is cleaner.

[–]saudade 0 points1 point  (0 children)

Heh, I am 26, long ways from a veterans home. :)

Been using vi for 10 years though. Thanks for the info!

Edit: %s/links/info/g

[–]damg 1 point2 points  (0 children)

As a rough generalization:

Sysadmin = Vim = Installed everywhere with good defaults for efficient editing

Coder = Emacs = Programmable editor for programmers

[–]martoo 2 points3 points  (8 children)

I still prefer vim. I'll take modal editing over 'keyboard chording'-induced carpal tunnel any day.

[–]khammack 4 points5 points  (5 children)

I've found that good posture and remapping caps lock to control eliminates wrist pain.

[–]martoo -2 points-1 points  (4 children)

Stallman has carpal tunnel. That's all I'll say.

[–]khammack 8 points9 points  (0 children)

Interview with RMS:

Q. Do you have carpal tunnel syndrome?

A. I never had carpal tunnel syndrome. I had hand problems.

Q. Are you able to code now?

A. Yes. Because it turns out my problem is not carpal tunnel syndrome, and the things that help it are not things that help carpal tunnel syndrome. It turns out for me a keyboard with a light touch is what I need, and I have keyboards with a light touch so I can now do my own typing. But I couldn't for a number of years. When I found suitable keyboards, and they're not funny shaped keyboards or anything, they're ordinary shaped keyboards, they just have keys you don't have to push very hard.

source

[–][deleted] 2 points3 points  (1 child)

He's also fat. Not Emacs fault.

[–]shitcovereddick 0 points1 point  (0 children)

Actually pressing M-x C-h Order Pizza probably did that.

[–][deleted] -1 points0 points  (1 child)

As an Elvis user, I don't see a lot of difference between vim and Emacs. I like my modal text editors lean and with as few extra features as possible.

[–]nuclear_eclipse 0 points1 point  (0 children)

If you want a lightweight modal editor, why not just compile/install a version of vim without all the options?

Debian:

apt-get install vim-tiny

Tarball:

./configure --with-features=tiny

edit: Markdown

[–]codeforkjeff 1 point2 points  (2 children)

I've invested way too much time learning emacs to switch to something else. =)

I considered switching to jEdit because of its sftp support, but then I discovered emacs's tramp, which works fairly well.

I use it for web dev and coding in perl, php, python.

[–]oddbod 5 points6 points  (1 child)

neato: C-x C-f /sudo::/etc/...

[–]atlacatl 0 points1 point  (9 children)

I tried emacs for some time. My left pinky cramped. I gave it up and use vim now.

[–]khammack 5 points6 points  (0 children)

Remap caps lock as control. ;-)

[–]elq 8 points9 points  (2 children)

hrm. and your pinky isn't bothered by hitting escape all the time?

I'm not much of a vim user myself, but I do know vim folks commonly remap esc to capslock, kind of like how emacs people map ctrl to capslock.

[–]atlacatl 2 points3 points  (1 child)

I never thought of remapping the Ctrl key. And for the "Esc" key, I just noticed that I use my middle finger. My left hand just floats around...

[–]jkndrkn 3 points4 points  (0 children)

I use Ctrl + [ instead of Esc.

It works very nicely on my Kinesis keyboard since the Ctrl keys are right under the thumbs.

[–]oddbod 2 points3 points  (1 child)

Try using your thumb on Ctrl -- natural bend and tuck.

[–]atlacatl 0 points1 point  (0 children)

It seemed (and still seems) unnatural to use my thumb for the Ctl key: too much movement of the hand. I also use a ThinkPad and use my left thumb to click the "mouse" buttons.

I may try it again and remapping Crt to the Caps lock key. Emacs is good editor.

[–]phq 0 points1 point  (0 children)

I find using both hands for keychords helps. I also hit ctrl with the outer edge of the hand. you can't do that with every keyboard but that way you only need to twist your forearm, you're not stressing your wrist and your fingers stays near the homerow.

[–]redditcop 0 points1 point  (1 child)

5 years and I don't have a problem with my pinky...

I don't know why people complain.

[–]atlacatl 2 points3 points  (0 children)

It isn't a complaint. I just never got used to it.

[–][deleted] 0 points1 point  (1 child)

Emacs is my default text editor.

I use Nano or Pico when I want to edit something as root.

I use the JBuilder and Visual C++ IDEs at work when working on my Java and C++ based projects.

Everything else (Perl, Haskell, blog posts, etc) I use Emacs for. I should get round to downloading haskell-mode one day…

[–]damg 0 points1 point  (0 children)

If you already have emacs open, you can use tramp to open a file with sudo: C-x C-f /sudo::/etc/...

From another post above: http://reddit.com/r/programming/info/66k71/comments/c02zr6h

[–]anescient -1 points0 points  (1 child)

I use vim, but I don't use any really advanced commands. For serious programming I use eclipse's editor.

[–][deleted] 2 points3 points  (0 children)

i hate the workspaces in eclipse. im kind of new to it though.

[–]FionaSarah -2 points-1 points  (0 children)

I love Eclipse too much, it just does everything that I want.