Stochastic Geometry

June 19, 2008

Emacs

Filed under: General,PHP,RCMS — Mark Dennehy @ 15:25

Hmmm. I started programming on an old ICL OPD (anyone else remember microdrives?). There was some fooling about afterwards with an IBM PS/2 system (woo-hoo, 40Mb of hard disk space!), but the first time I hit what I thought of as a real machine was on a unix account in the first week of college. And that’s when I first hit the biggest question any starting computer engineer hits (or used to hit, back then): Vi or Emacs.

Back then, I chose Vi by default, in that it was the first thing I came across and command/edit mode switching actually made sense to me. And I used vi for a good while afterwards, until I finally found, and immediately switched to, vim. I’ve used vim ever since for any task where I could use it on any platform where I could get it (in fact, not being able to use it for wordpress blogging ticks me off). Being able to run around a source code file in command mode and dd or y lines from here and p them over there, or J them together or call up boxes with an <F4> remap to give me a nice easy-to-spot function header, those are things I’ve gotten down to the reflex level at this stage. In short, I like vim. It’s small, fast, uncluttered. And don’t talk to me about tabbed editing and intellisense and debugger integration please, that’s been in vim for quite some time if you want it (and frankly, if you’re using Visual Studio anything and telling me it has a better editor, you seriously need to stop wasting your time). Not to mention the fact that everytime I’ve seen something like intellisense in actual use, it’s been used by some rather lazy programmers. Which isn’t to say that brace completion and the like can’t be used by good programmers, just that my impression so far hasn’t been a good one. Lie down with dogs, get fleas in your keyboard…

Anyway, the thing is, I’m familiar with the claims about the immense customisability and power in Emacs, but by the time I’d started to hear about it, I’d learnt vi, and once you learn an editor and there’s work to be done, it’s hard to justify the effort to relearn another one. Feels too much like faffing about. But right now, work’s in the research phase (ie.  Feck! Why won’t that work? Damn, go read the devel mailing list archives and the code…), and I have my little side project for the rifle club tootling away, and apparently XEmacs/GNU Emacs is now a run race and GNU Emacs is now a full superset of xemacs so there’s an easy install choice, and GNU Emacs 22 supports mercurial (there’s a blog post in there on its own methinks) out of the package, and PHP with a simple apt-get install, and the more tools you can use the better, right?

So I’ve installed a basic GNU Emacs setup on the work and home boxen with a PHP major mode, and over the next week or so, I’m going to try to use it for my side project. If that takes off, I’ll think about using it for the main project and where it fits into my toolbox overall. I suspect vim’s still a winner where another app has to call an editor (VCS commits from a command line and such) or where you’re running round /etc trying to fix something, but we’ll have to see.

First thing I have to figure out is what the emacs equivalent to command mode and edit mode are…

Advertisements

12 Comments »

  1. When using Emacs, you live inside Emacs. There’s no reason to start it quickly for editing a file, as you are already in it /hugely different concept to Vi(m)/. For Emacs there is a mode called ‘viper-mode’ that provides a Vi(m)-like behaviour, may be you should give it a try in the first days until you get familiar with Emacs.

    Comment by slink — June 19, 2008 @ 20:19 | Reply

  2. I know, I know, I understand the whole “start ‘er up and leave ‘er running” philosophy. I’m just dont get it yet is all.
    And viper mode or vile, both seem to be cop-outs. Either I learn emacs or I don’t; half-measures where my fingers are acting like I’m in vi but my brain’s thinking in emacs, they just don’t appeal.

    Comment by Mark Dennehy — June 19, 2008 @ 20:39 | Reply

  3. I figure here’s as good a place to log small notes about my progress by the way, so:

    Fonts. What the bloody heck? I have to get an emacs development snapshot for reasonable fonts? Or M-x set-font-default blah? Come on, there has to be an easier way than this. At least the color themes have a menu to choose from (and this is a good place to use a menu bar, btw, I might never use the thing in vim at all, except for picking fonts/colors when I feel like a change.

    On color schemes, has zenburn been translated to an emacs color scheme?

    I will say, by the way, that after an unreasonable amount of time wrestling with the fonts in emacs, I am rather happy with the lisp machine font from here. So much so that it’s now my default vim font too 😀

    Comment by Mark Dennehy — June 19, 2008 @ 20:43 | Reply

  4. And how long before my fingers stop typing Esc-C-x instead of C-x I wonder?

    Comment by Mark Dennehy — June 19, 2008 @ 20:44 | Reply

  5. How can one live without Ctrl-P? 🙂

    Comment by MD — June 21, 2008 @ 13:27 | Reply

  6. More updates:
    As tutorials go, the emacs tutorial is pretty decent.

    I’ve given up on fonts and colours and am sticking with the lisp machine font and the “Charcoal Black” theme for now. Zenburn it ain’t, and I miss Inconsolata, but it’ll do for now.

    I’ve started a .emacs file with some basic stuff.

    I still haven’t gotten used to not having a command *and* an insert mode.

    Comment by Mark Dennehy — June 23, 2008 @ 15:55 | Reply

  7. Gah.
    Seriously.
    :set nu versus finding linum.el, downloading it, creating .emacs.d/elisp and adding it to the load path, then (require ‘linum) and (global-linum-mode 1)
    I mean seriously, that’s not a very user-friendly way of doing stuff. Even if your user’s not clueless.

    Comment by Mark Dennehy — June 25, 2008 @ 10:37 | Reply

  8. Mark, check out .

    It’s so weird that I randomly stumbled onto this page a mere week after you posted this…

    Comment by Daniel Brockman — June 26, 2008 @ 17:06 | Reply

  9. Well, it ate the URL. Here it is: http://www.brockman.se/software/zenburn/

    Comment by Daniel Brockman — June 26, 2008 @ 17:07 | Reply

  10. Argh! I thought that was going to be the answer to my problems Daniel, but it seems the zenburn I love in gvim is not the zenburn for emacs 😦

    Comment by Mark Dennehy — June 26, 2008 @ 17:17 | Reply

  11. I’m *seriously* getting annoyed at all the work I have to do with emacs before I can get any work done on, well, my work. I thought a straight ubuntu install would be grand, but I’m finding that all the things that I’d use in emacs are taking a lot of work just to get running. Completion, version control, fonts, colours, the works. All of them require you to invest time to customize the system to you before you can use it (I can’t use M-TAB for completion in php-mode because it’s a KDE key to change apps, for example).

    I’m *this* close to calling the whole thing off, I swear.

    Comment by Mark Dennehy — June 26, 2008 @ 18:23 | Reply

  12. That bomberman game was prob intense with let the bodies hit the floor song in the background

    Comment by mario5brothers5 — January 17, 2009 @ 08:01 | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: