Archive | emacs

Using Version Control in Emacs

Jun 20th, 20081 Comment

I’ve recently discovered another wonderful thing about Emacs – Version Control

Let’s say you are working on a project that is under some version control system.  You are editing a file and you type “C-x v v”.  Then Emacs will do the next logical thing with that file.  If the file is not on version control, it will be added.  If it is, it will ask for a comment and check-in the file.  Note that no where do you actually tell Emacs which version control you are using.  It knows. I’ve done this successfully with Mercurial and Subversion and apparently their are many more.  I haven’t tried it under MKS, but that’s okay, because I refuse to use it anyway.

If you use Dired, then you can do “C-x v d” which is Dired under VCS.  See here for more about that.

Another Emacs/Textmate Comparison

Mar 11th, 2008No Comments

While Blaine starting to attend the Church of Emacs I’m sorta having a crisis of the faith. I’ve been working on a Rails project lately and have gotten re-acquainted with Textmate again. I remembered why I liked it so much — it’s project mode is perfect for the many, many files of Rails. And it’s HTML mode is really quite spectacular.

But then something happened. I needed to put about 20 records into a page. So I needed to take a list from the db migration that looks like:

       t.string  :name
       t.string  :label
       t.text  :value...

And turn them into:

<%if object.name%><%=object.name%>

<%end%><%if object.label%>

<%=object.label%><%end%>

Ugh. That’s a lot of rote, dumb, error-prone typing. But wait! Emacs has keyboard macros! I quit Textmate, started Emacs and in five minutes I was done.

So which is better? I hope for a combination of them– Emacs with some of Textdrive’s nifty completions/templates. I can do a lot of that in Emacs but it’s error-prone and won’t necessarily work right all the time. Hrmm . . .

Emacs Cheatsheet for 2008-02-28

Feb 28th, 2008No Comments

And you thought I would make another one. Ha! Some are the same as the last one, but there are some new ones.

M-d -> kill up to the end of a word

M-t -> transpose

M-h -> mark paragraph

<f4> -> re-run last kbd-macro

M-u -> uppercase word

M-l -> lowercase word

M-c -> capitalize word

C-x C-u-> uppercase region

C-x C-l -> lowercase region

Some Quick Things

Feb 5th, 2008No Comments

Yep, it’s that time I put a bunch of random stuff together in one post. Deal with it.

  • Anyone else in Omaha sick of the snow besides Gina and I?  I can’t believe my backyard has been covered since December.
  • Leah had a severe cough all last week.  On Saturday we took her to the doctor and, sure enough, it was what we feared — pneumonia.  They put her on antibiotic and it’s working okay.  The cough seems better anyway.
  • A couple guys have forked a long-dead Jython shell project and has given it a rebirth and have called it iJython.  It’s still early, but I’ve used it and it’s very cool.
  • Best Doctor Who quote ever:

Rose (to Dalak Leader):  Five million Cybermen, easy. One Doctor? NOW you’re scared!

This was just after the Dalaks and Cybermen were talking smack to each other.  Sheer geek goodness.

Emacs Cheat Sheet for 2008-01-02

Jan 2nd, 2008No Comments

One of my goals for 2008 is to work on my Emacs-fu, i.e. learn more of the nice abilities that Emacs has. I read a lot of Emacs-centric blogs and programming.reddit.com sometimes has some nice things. But how can I remember those nice things? And how can I get the nice items that Emacs already has built-in that I read about, but can never get integrated into my brain?

This post suggests what could be a winning solution for me – make a Emacs cheatsheet with those items you want to embed into your brain. Every few weeks, evaluate what you have on there, add new items, remove non-useful things, etc. I think will work wonderful for me! And, you know, why not post my new cheatsheets on my blog when I change them out?

So here is my first Emacs Cheatsheet for 2008. If the commands don’t come with standard Gnu Emacs, then I will link to the page I got it from.

M-@ select word
M-d kill up to the end of a word
M-t transpost
M-h mark paragraph
<f4> re-run last kbd-macro
totd tip of the day
C-x 0 close this window
calc learn it!
C-c l copy a line without selecting
C-c p copy a paragraph without selecting

 

Page 1 of 41234»