Adam Monsen

July 30, 2007

Vim tricks from OSCON 2007 and beyond

Filed under: Default — adam @ 9:20 pm PST

I stopped by OSCON to attend two tutorials this year. The first was Advanced Vim Scripting, led by Steve Oualline (sitting in for Damian Conway). I was sad to miss The Damian, but Steve is a decent lecturer and boasts endless knowledge of the Vim editor. I enjoyed Steve’s rapid-fire pace and attention to detail. I also grilled him fairly heavily and he aced all my questions.

Lessons learned:

  • additional C syntax highlighting goodies are documented in :help c.vim. For instance, to make trailing whitespace and space before a tab character stand out, add let g:c_space_errors = 1 to your .vimrc
  • using functions and “autocmd FileType” lines is a fine way to customize language-specific settings in your .vimrc
  • type CTRL-W ] on a C symbol name to open up the corresponding declaration in a new window
  • TextMate snippets-like template fill-in is possible using a plugin
  • :vimgrep is cool

I was also inspired to dig into some other C navigation settings. Here’s a quick mini-HOWTO:

  1. install source code tools: sudo yum install cscope ctags (on my Fedora 7 system)
  2. Generate indexes for the current project: ctags -R && cscope-indexer -v -r
  3. in normal mode, "kick the tires":
    1. find references of symbol under cursor: :cscope find s <cword>
    2. find callers of function under cursor: :cscope find c <cword>
    3. find functions called by function under cursor: :cscope find d <cword>
    4. when editing a header, find files which use it: :cscope find i %

I also happened upon Kana's blog, and got more ideas from there (thanks, Kana!):

  • use fold markers to clean up plain text files (see my .vimrc linked at end of post)
  • use 'noequalalways' setting to prevent split window automatic resizing
  • use local function definition and calls to prevent namespace pollution (see my .vimrc)

Other sundries:

My ~/.vimrc

I also attended A Taste of Haskell. In a nutshell: Yikes. Larry Wall said it best: "I think Haskell is easy. I've learned it three times already!"

July 23, 2007

Out of Africa

Filed under: Default — Tags: , , — adam @ 7:00 am PST

Yesterday we returned from our adoption trip to Ethiopia. We met many kind and interesting people and learned a ton about how adoption works there. I already miss my new niece and nephew!

Eva also blogged about this trip, and put our photos up on Flickr.

The country itself was of course amazing; unlike anything I’d ever experienced.

Now it’s on to OSCON, just for today. I’m pretty stoked to dig into some advanced Vim scripting techniques as well as Haskell. If you’re here, drop me a line.

July 11, 2007

Brevard BioDiesel Blog

Filed under: Default — Tags: — adam @ 12:40 pm PST

This is a plug for the Brevard BioDiesel Blog.

I was thinking about updating my broken Google Maps biodiesel stations mashup, but balked since someone over at Brevard created a much more complete map! It includes stations all over the United States using data from biodiesel.org.

A cursory perusal of their blog yielded interesting posts on Honda plans for selling new diesels (instead of hybrids) and problems/FUD regarding palm oil.

July 9, 2007

Trac Ball will Now Be Remembered

Filed under: Default — adam @ 12:09 am PST

I noticed the at Whirlyball article on Wikipedia had no mention that the scoop used by players is actually a Trac Ball racquet. In fact, there was no Trac Ball article until about five minutes ago!

This is history in the making, folks.

July 7, 2007

Now Featuring: Ads?!?!

Filed under: Default — adam @ 7:19 am PST

Unless AdBlock is filtering them or you only subscribe to my RSS feed, you’ll now see a “skyscraper” of text-based supposedly targetted ads in the right-hand column.

The WordPress theme I switched to had a nice template for ads so I thought I’d give it a shot and see if I could offset the cost of hosting.

Now’s your chance to let me know what you think. Get rid of ‘em? Don’t care? Good for me? Let me know.

So far the targetting seems pretty crappy, so I guess I need to write more posts about stuff that I like!

July 4, 2007

Wikipedia and The Weird

Filed under: Default — Tags: , — adam @ 7:00 am PST

I don’t really have much to add to today’s link, except to say that there is definitely something here that will make you laugh, wax nostalgic, or gasp.

Happy Independence Day!

July 2, 2007

Sleeeeeeeep

Filed under: Default — adam @ 7:55 pm PST

What is sleep? It’s when you rest. Rejuvinate. Take a break. But in a special, apparently irreplaceable way.

Why do we sleep? There are lots of theories, but it appears we still haven’t figured this mystery out.

It seems that one “researcher” knows what happens when we sleep.

Powered by WordPress