DISQUS

SIGUSR2: SIGUSR2 > The Power That is GNU Emacs

  • Steve Purcell · 7 months ago
    And if you move your .emacs to .emacs.d/init.el, you won't even need the former any more.
  • Andrew Gwozdziewycz · 7 months ago
    hmm.. i'll have to investigate this further. Not really sure what this gets except for the ability to zip up everything in .emacs.d when I need to move it. That's not a deal breaker for me though.
  • a · 7 months ago
    Most of these customization are available in Vim. I wonder if you ever used Google for things in Vim like you used for Emacs.
  • Josh · 7 months ago
    With respect, Emacs still has an edge. I enjoy having VIM users watch over my shoulder and say things like, "Whoah, how did you do that?" I try really hard not to tell them that they can actually do the same thing in VIM (I'd rather them switch to Emacs).

    I know almost as much about VIM as Emacs, but the feeling of an environment of code and sense of live extensibility is far greater in Emacs. It matches what programming is, I think.
  • A · 7 months ago
    Hmmm, I don't know. I use Emacs regularly, only for the Org mode. But for rest of my editing, with real editing modes, I use Vim.

    Vim, sure does not come with Elisp, but it has a very powerful macro and builtin scripting language too.
  • Moog · 7 months ago
    Vim has a scripting language but its power is questionable, or maybe the environment is the one which is limiting. I mean, the language feels quite capable when you look at it on theoretical level. But in practice it's very difficult to write any non-trivial extensions which actually work well in Vim. There are some good ones in www.vim.org but even those seem to have some corner cases which make them mutually exclusive with certain settings or with other extensions. I have often got weird "autocmd" errors when I did something unexpedted, and had to restart my Vim session. I often ended up disappointed after trying extensions in www.vim.org.

    If Vim's scripting language is powerful then why is there not much large extensions or applications running inside Vim? Vim extensions rarely go much further than being small convenience wrappers around some existing Vim command set. There are nothing like Emacs's Gnus or Org-mode, for example.
  • Steve · 7 months ago
    To answer your question about deleting C-z: very old versions of DOS used ^Z as an end-of-file marker.
  • Andrew Gwozdziewycz · 7 months ago
    Thanks steve! I knew there must have been a good explanation for it.
  • Kevin · 7 months ago
    Windows XP is not a very old version of DOS but it still uses ^Z

    G:\>copy con outfil
    test
    ^Z
    1 file(s) copied.
  • David House · 7 months ago
    "This time, I knew to chord C-x f, make my changes and chord C-x C-s. Easy-peasy."

    I don't think `set-fill-column' is the traditional way to open a file... perhaps you meant `C-x C-f'.
  • Andrew Gwozdziewycz · 7 months ago
    Yup, I did mean that. I'll make the fix.
  • The One True Josh · 7 months ago
    Well, you've inspired me. I've stolen your three-quarters-window func. and altered it to create the three-way view that I like. I've used emacs for years, but there are a lot of capabilities that I've never touched.

    I work in an environment where the best way for me to work is in emacs in an xterm. An X window (through cygwin...) is just too slow. It's forcing me to do much more in the "proper" way. I was using the mouse far too much. The complexity of minor and major modes still intimidate me, though.

    Thanks for the write up. It's improved my life.
  • Reader from reddit · 7 months ago
    You might want to look into the set-buffer-file-coding-system function (usually bound to C-x RET f).
  • sep332 · 7 months ago
    I'm not belittling the power of Lisp, but it is rather old. If you think that's powerful, you should see what Alan Kay's Viewpoints Institute has been up to in the meantime: http://www.vpri.org/
  • marriott · 7 months ago
    I'd like to see a side-by-side chart of how to do this in vim (or showing that it's not available).
  • Evan Meagher · 7 months ago
    I recently started learning emacs while doing CS problem sets this quarter and I've left gedit untouched and lonely ever since. I didn't realize emacs was so powerful! I'll definitely be referring back to your article as I learn more. Thanks for posting!
  • Anonymous · 7 months ago
    FYI, set ff=unix and set ff=dos does the same thing your script does in Vim. =)
  • klang · 7 months ago
    I inherited something similar my Emacs pusher in 1997. I like your use of mapcar and have adjusted my code accordingly :-)

    After 10 years of Emacs usage, I realized that I would never use another editor and started being a bit more interested in elisp. Previously, I had only added simple customizations. Today, I have my complete set of customizations on github for easy access and synchronization between windows, linux, unix and mac. I do not care about the operating system, as long as emacs is available.
  • Alexander · 7 months ago
    vi < emacs < gvim
  • c · 7 months ago
    the last paragraph gives the reason why. off course one can use other tools and maybe even be similary productive (productivity is inside head, not insed toolchain). but it is more joyful to use emacs. and that is part of the equation (of what is your life).
  • Some Hack · 7 months ago
    Disclaimer: I am not using Emacs to leave this comment.

    Productivity is the driving force behind using any tool. Emacs undoubtedly stomps all competition in this department.

    For example, people are constantly sending me data in Excel files that needs to be used out of Excel. Emacs makes it extremely easy to sort, cut, filter, merge, etc… the pasted rows.

    Macros and registers allow me to easily place the given piece of text into the appropriate context (usually some XML or an SQL query).

    And then when I save, the XML file is automatically validated. The SQL query, well I can run that too, all without touching the mouse or having to holler at Alt-Tab.

    For everyone spewing this "we'll Vi can do it too" crap I'll have to quote that lying incompetent dooshbag Arnold Schwarzenegger and say- "Stop Whining!" We all know Vi is feature packed too OK.

    Though I will give Vi credit for its ability to handle large files. Where out-the-box Emacs falls short at (expt 2 27) I believe.

    I just need a grow/shrink-window-if-larger-than-buffer mode…
  • Jonathan Aquino · 7 months ago
    How about jEdit? The macro scripting language is BeanShell (equivalent to Java), which makes it easier to program for people familiar with Java.
  • Andrew Gwozdziewycz · 7 months ago
    I haven't used jEdit. I will point out that elisp is major factor for most people. There are two projects that I'm familiar with that are an attempt to rectify this:

    http://www.emacswiki.org/emacs/PyMacs, for extending emacs through Python. This works, but I haven't tried it.

    http://code.google.com/p/ejacs/, which Steve Yegge originally wrote for extending emacs through Javascript. I'm not sure the status of this.
  • whiteinge · 7 months ago
    Well written. Anyone who edits text/source code for a living will find that it is well worth devoting time to truly *know* your text editor of choice.

    That said, comparing Emacs to vi is an apples-to-oranges comparison. Of the three most popular vi-clones (ex-vi, nvi, and Vim) only Vim has significant mindshare and modern features. Emacs and Vim compare quite well and are functionally equal -- it's really just a matter of personal preference. For example, referencing a paragraph in your post, I only ever use one Vim instance for editing many, many files at once and Vim is designed to do that very efficiently -- just like Emacs. :)

    Thanks for the interesting read.
  • Jack · 7 months ago
    Fack emacs man... VIM all the way...
  • Andrew Gwozdziewycz · 7 months ago
    I would mark this as spam, but it's the way many people feel, so I won't. The purpose of this post was to not be a flame war, and give the reason that I myself, choose Emacs. If you feel so strongly about VIM, write your own post about why you choose VIM, but do everyone on the Internet a favor and don't start another flame war. We're tired of this battle that can never be won (by either side) of "emacs" v. "vi(m)." The editor war is over, we've all won!

    I propose a new law of Internet conversation: "Any conversation about text editors eventually diverges into a flame war between emacs and vi(m)."
  • dysfunctor · 7 months ago
    Well said!

    Of course, you can never *tell* someone why emacs rocks. You can only show them how emacs helps *you*, and let them figure our the rest for themselves.

    For what it's worth, Vi is a fine tool and invaluable in some contexts -- think of sysadmins who have to tweak all kinds of scripts on all kinds of machines -- but for the full-time coder, Emacs wins. Modern editors (Visual Studio, Eclipse etc.) certainly *look* better and are much more newbie friendly, but none of them have the Lisp nature.

    I wonder what an editor with ... say ... the Javascript nature would be like? https://bespin.mozilla.com/
  • Nick Mudge · 7 months ago
    Thanks. After reading this I've decided to learn how to use emacs.
  • Lee · 7 months ago
    I started writing C in 1982, needed a better editor than DOS edlin, and bought "Epsilon" which was advertised as a programmer's editor. I didn't know it until I started using Linux, a dozen years later, that Epsilon was an Emacs clone. It made the move to Linux painless. I quit using word processors long ago and write HTML documents with my editor (sort of like WordPerfect codes mode). Except for browsing, I spend all my computing time (about 85%) in the Epsilon Emacs editor (DOS and Linux editions). Emacs works.
  • Bob · 7 months ago
    The BIG win for emacs over vim is comint mode, the ability to run a REPL inside emacs. This turns it into an IDE and once you get the hang of it there is no return. I'm a long time vi user and use viper in emacs so switching to vim would not be hard. However, until vim can run REPL's as well as emacs I will not even consider it.
  • Edwin · 5 months ago
    Very interesting indeed but too complex for me to comprehend. I dont know a thing about Lisp
    except that it uses parenthesis a lot. anyway good article. i starter to learn about programming as Im also looking to see which text editor to use and I dont even know yet which programming language I will stick with
  • Andrew Gwozdziewycz · 5 months ago
    You might wanna take a look at Python. It's a great language for beginners and professionals alike! Easy to learn, and fun to use! As for editors, you don't need anything complex to learn, so just choose what's right for you for now. Eventually, you might wanna try out emacs since there are lots of features that make it great for programmers, some of which I've outlined above. Good luck!