Live data from Hacker News

The single most useful Emacs feature

stackoverflow.com

41–50 of 112 posts

Re: The single most useful Emacs feature

#43
TRAMP. Being able to seamlessly remotely edit files and run remote modes.

At work I regularly edit files on 10-15 remote machines. But I never ssh to them and run an editor. Instead I'll just visit them through TRAMP, run Magit to commit stuff that I've done etc.

Re: The single most useful Emacs feature

#44
post #43

TRAMP. Being able to seamlessly remotely edit files and run remote modes. At work I regularly edit files on 10-15 remote machines. But I never ssh to them and run an editor. Instead I'll just visit them through TRAMP, run Magit to commit stuff that I've done etc.

My coworkers often don't even realize I'm editing a remote file or working in a remote shell. It's really that seamless.

Of course, sometimes I forget I'm working remotely, and hilarity ensues. The worst episode was in a recent school project. I thought "oh, I'll just finish this on the train". And then, when I got on the train, realized I had actually been working remotely. Oops.

Re: The single most useful Emacs feature

#45

record and play macro (someone had to mention) C-x ( C-x ) C-x e M-x 99 C-x e (play macro 99 times)

Also note that

    C-u 0 C-x e
plays the macro until it rings the bell (e.g. runs out of buffer space or tries to forward-search for a name that doesn't exist. This is great when you don't know how many times it needs to be run.

Re: The single most useful Emacs feature

#46
post #37

It's interesting that it's hard to explain, because the fingers will play the chord by themselves and I need to stop and think to know what I am actually typing. C-x r k to cut a rectangle, and C-x r t to add one filled with, for example, the comment symbol: (C-space)this to comment C-x r t # #this #to comment

You can also use the M-x comment-region and M-x uncomment region to comment stuff. If you use it a lot, just bind them to a convenient key stroke.

Re: The single most useful Emacs feature

#47
post #7

Good god. I've been using emacs since 1981 and this thread is teaching me things.

Likewise! How will I ever get any work done with all these new productivity features I'm learning about! My favorite Emacs feature that I've learned about in the past year is Org-Mode. I use it now for just about everything.

Org-mode is what finally converted me to being an emacs user.

I'd been searching for a lightweight, console/cli-mode outliner/task-manager when it occurred to me "surely emacs has something for this". It did, of course.

For several weeks I used emacs only for org-mode. Slowly but surely emacs started to take over my more and more of my editing tasks. Now I find myself not even bothering to launch X, but simply emacs from the Linux console (run level 3?). It's amazing how responsive a computer is when you're not using any gui at all.

I've since discovered that org-mode is pretty common gateway into emacs.

Re: The single most useful Emacs feature

#48

This is not really a feature , as such, but it is a classic work-around for one emacs' many silly defaults: ; Ask for y/n on all queries that normally ask for yes/no. (fset 'yes-or-no-p 'y-or-n-p)

I personally don't think that default is silly. I've noticed that some (usually less important) questions use y or n already; the yes/no is reserved for important ones. I don't mind having to type a bit more before recursively deleting a directory, for example.

Re: The single most useful Emacs feature

#49
post #18

For Vim users like myself, there's a related Stack Overflow Discussion: What is your most productive shortcut with Vim? http://stackoverflow.com/questions/1218390/what-is-your-most...

The very phrasing of these two questions highlights the philosophical differences between emacs and vim: "feature" vs. "shortcut".

Re: The single most useful Emacs feature

#50
post #26
post #9

Earlier quoted context omitted.

Occur also works nicely for this use case, as you can visit each place in order with C-x `. Actually, something like eproject-grep is even nicer, because you can visit every occurrence in the project that way.

I didn't know about occur, which is awesome and thanks. The benefit of hi-lock is that I can "read" code without actually having to "read" it. Instead, I can either set myself up to look for patterns of colors (function --- red line --- shit no blue line!), or set myself to serendipitously discover things as I actually do read code. I have never, ever, ever, ever figured out an Emacs "grep" that I liked enough to sto…

Have you tried ack? http://betterthangrep.com/

There are some ack-modes for emacs, too, eg. https://github.com/nschum/full-ack

Post reply on HN