M-x all-things-emacs

Yet Another Snippet Package

March 13th, 2008 by Rob Christie · 110 Comments

There are a number of snippet packages that are available for emacs: snippet.el, smart-snippet, and the older skeleton and tempo packages that are a part of emacs. The snippet package was in the words of the developer:

A quick stab at providing a simple template facility like the one present in TextMate (an OSX editor).

The creator of smart-snippet, an extension to snippet.el, has now created the aptly titled yasnippet – Yet Another Snippet extension for emacs. It looks promising based on the screencast… I have not had a chance to play with it yet locally. The mirrored fields support looks cool though.

→ 110 CommentsTags:misc · snippet

Fixing Pastie for Emacs

January 7th, 2008 by Rob Christie · 92 Comments

Pastie Icon Recently, I have been doing more remote pair programming at my day job, and I was copying some code snippets into pastie. Pastie is a site that allows you to share code snippets with nice syntax highlighting. One thing led to another, and next I was searching for emacs integration with pastie. I found it here, but unfortunately the lisp package no longer seemed to work. It turned out that the package just needed to support a minor change to the pastie API. I have fixed it, and added support for sniffing more of the emacs modes associated with Ruby on Rails and java. Here is the updated version of pastie.el. (Note: After publishing I added it to the emacs wiki based on a user’s suggestion: pastie.el). The package has the following functions:

pastie-buffer – Posts the current buffer as a new paste at pastie.caboo.se.
pastie-region – Posts the selected region as a new paste at pastie.caboo.se.
pastie-get – Fetches the contents of a paste from pastie.caboo.se into a new buffer.

→ 92 CommentsTags:misc · rails · ruby

Where In The World Are Emacs Users?

October 26th, 2007 by Rob Christie · 64 Comments

Every few months you see a thread on the emacs news groups polling to see the age or occupation of the users. Recently someone sent out a link on gnu.emacs.help to a site called BuddyMapping with a map for Emacs Users. I have always loved maps, and I am a sucker for these map mash-ups, especially when there is no registration required in order to add yourself.

The thread also points out that the Emacs Wiki contains a list of Emacs User Locations (in text form of course). There is also a link to an Emacs Flickr tag.

→ 64 CommentsTags:misc · news

Declaring .emacs Bankruptcy

October 7th, 2007 by Ryan McGeary · 109 Comments

I give up. During the past 6 years of my emacs career, my .emacs initialization file grew to embarrassing levels. As of this morning, it is well over 1000 lines and is a looming burden of disorganization. Startup time is poor, customizations exist for modes that I don’t use anymore (ahem, csharp-mode), and it has been this way for too long.

Today, I am declaring .emacs bankruptcy.

Akin to email bankruptcy, I’m blowing everything away and starting over. Only as I realize a need for something is it going back in. I’m also starting with a better organization scheme. My intent is to have a .emacs file with nothing but load-path additions and requires.

[

→ 109 CommentsTags:misc

Quick Tip: Spaces instead of Tabs

September 30th, 2007 by Ryan McGeary · 105 Comments

Tab characters used as indentation of source code is a pet peeve of mine. Add this to your emacs initialization to make sure all indentation uses spaces instead.

;; I hate tabs!
(setq-default indent-tabs-mode nil)

Now, if you also use tab completion everywhere, someday, you’ll want to actually insert a real <tab> character (ASCII 9), but won’t be able too. Quoted-insert to the rescue. Type C-q C-i to insert a horizontal tab character.

Note: Even though, I’ve aired my religious preference on this topic, my intention is not to start a war but to teach those who like spaces how to configure emacs (Yes, I’ve read the heated material on the subject).

→ 105 CommentsTags:newbie · quick · tips

Newbie Tip: Visual Emacs Keybinding Cheatsheet

August 27th, 2007 by Ryan McGeary · 162 Comments

For a newcomer to emacs, learning the default set of keybindings can be daunting. There’s no substitute for C-h b (describe-bindings) and C-h k (describe-key), but sometimes it’s just easier to learn visually.

Visual Keyboard Keybinding Cheatsheet

→ 162 CommentsTags:newbie · quick · tips

Quick Tip: show-paren-mode

August 7th, 2007 by Rob Christie · 115 Comments

When show-paren-mode is enabled a matching parenthesis is highlighted based on the location of point (i.e., when your cursor is on a parenthesis). show-paren-mode Example
You can tweak the behaviour of this minor mode by adjusting show-paren-style and the show-paren-delay. There are three styles to choose from:

  • parenthesis – shows the matching paren
  • expression – shows the entire expression enclosed by the paren, and
  • mixed – shows the matching paren if it is visible, and the expression otherwise.

To obtain this behaviour, add the following to your .emacs file:

(show-paren-mode t)

→ 115 CommentsTags:newbie · quick · tips

Package Faves: rcodetools

July 21st, 2007 by Ryan McGeary · 84 Comments

rcodetools-xmpfilter Rob recently pointed me to rcodetools and its included emacs integration. Specifically, I’ve only had the chance to play with xmpfilter, but so far, I’m very impressed. Let’s use it to annotate lines in a ruby buffer with intermediate results.

[

→ 84 CommentsTags:faves · reviews · ruby

Package Faves: emacs-rails

June 10th, 2007 by Rob Christie · 173 Comments

The emacs-rails package turns emacs into a Ruby on Rails IDE. To put it simply, I love the package. It gets me excited to see this much active development for an emacs mode. The emacs wiki has a laundry list of the functionality that the mode provides. I don’t think a single blog post can do the functionality justice, so I just want to hightlight a few of the features below (and expand on other features in later posts). [Read more →]

→ 173 CommentsTags:faves · rails · reviews · ruby

Quick Tip: delete-blank-lines

June 7th, 2007 by Ryan McGeary · 259 Comments

The delete-blank-lines function is a simple yet handy tool to have in your bag of tricks. It is bound to C-x C-o. There isn’t a whole lot of magic surrounding it’s usage, so I’ll just quote the built-in help directly:

On blank line, delete all surrounding blank lines, leaving just one.
On isolated blank line, delete that one.
On nonblank line, delete any immediately following blank lines.

delete-blank-lines before
delete-blank-lines after

→ 259 CommentsTags:quick · tips