I just watched Corey Haines’ lightning talk from this year’s acts_as_conference:

He makes a lot of really good points in a short amount of time. One of the things he says is that if we have to look at documentation for a technique, we’re unlikely to use that technique when we’re in a time crunch. I think this is a very good point. Another time when I might not use the documentation is when I’m just dabbling.

To learn things, he suggests doing arbitrary tasks repetitively to get them engrained into our minds.

I spent a number of hours doing arbitrary tasks with vim, and I’ve gotten pretty good at using vim IMHO. I wish I could say I was as good at jQuery, but I haven’t got it down as well despite doing real projects in it. I think perhaps it’s best that I pick an arbitrary task, or at least do a real, but small, task repetitively, or keep trying to improve it, until I start to really get the hang of it.

On a side note, Corey Haines’ has quit working a regular job and started traveling around and pair programming with people in exchange for room and board. He calls himself a Software Journeyman. It will be interesting to hear what he learns from the experience. I hope his journey takes him to Arizona at some point!

This is just a quick update on how I’m using the enter key in vim. The sticky shift-enter key configuration didn’t work out for me. After pressing shift-enter once, I found that I would press shift-enter again, expecting it to create a newline. I wound up just remapping <CR≫ to <Esc>, and using shift-enter to insert newlines, or pressing enter and then “o” or “O” to create a new line above or below the current line. I use the latter option most. The only time it doesn’t work is when I need to split a line into two. For that I use shift-enter.

Shift-enter doesn’t work when using vim in a terminal, so the remapping doesn’t work quite as well in the terminal. I use it anyway, though. I should remap something to split a line into two, but so far I haven’t. I use vim in the gui (MacVim) most of the time. The couple of times I’ve had to split a line in the command line, I’ve hit:

  • D to delete the rest of the line and yank it
  • o to open a new line
  • Enter to get out of insert mode (since it’s remapped to Esc)
  • p to paste the rest of the line, that I deleted earlier

…which is terrible. If I start using command-line vim more often I’ll add a mapping for it.

This might seem like a pain, but for me it beats reaching for the Esc key. YMMV.

Update: zenzike pointed out in the comments that if you remap CR (the enter key) in the terminal, Control-CR still inserts a newline. So you could use Control-CR to insert a newline if CR was remapped to Esc. Unfortunately, this doesn’t work for me in OS X’s terminal or in iTerm by default. It does, however, work in gnome terminal running under Ubuntu on VMWare Fusion. I’m not sure why it doesn’t work in either of the two OS X terminal programs. I would be curious to learn why it doesn’t work and how to fix it, though, as this otherwise a very nice solution.

A few weeks ago, I started using vim as my main text editor. Soon after that, I installed the vimperator Firefox extension on my main computer. A few days into the use of these two tools, I was really excited about both of them. It takes more than a few days for me to know whether I’m comfortable with using a particular piece of software regularly, though.

I’m still using vim every day, and I like it. It’s powerful, ergonomic, and customizable. There are a few annoyances. I still haven’t figured out how to properly configure Firefox to use MacVim as an external editor. Vim doesn’t support having multiple frames for a single instance of vim (emacs does). The official wiki, hosted by Wikia, has horrible ads, and I refuse to install an ad blocker, because I don’t want to turn a blind eye to virtual blight like the maintainers of vim have. Nevertheless, I’ve become quite comfortable with vim and will continue using it. While I’d like it much more if it didn’t have these annoyances, it has relatively few annoyances compared to some other editors I’ve tried, and the good things about it outweigh the bad.

My experience with Vimperator was different. As with vim, I really enjoyed using it at first. Over time, though, I found myself growing tired of it, even though it enabled me to browse faster. The biggest problem for me was that the commands only work if I’m in the normal mode, and it’s very easy to get thrown out of the normal mode. The two things that most often put me in the wrong mode were full-page Flash files and JavaScript that placed the focus in text boxes. Another issue was that I couldn’t easily use the keyboard to scroll in a div. I can’t easily do that with normal Firefox either, but Vimperator is supposed to make browsing with the keyboard easy, and it does it for the most part.

I uninstalled vimperator, but I miss its functionality. I’d like a lightweight extension that makes it easy to click links or jump between form fields with the keyboard. I don’t think that the vim input model is suitable for keyboard navigation within a browser, because the browser environment is too unpredictable. I’d like to see a couple of multi-key combinations that activate keyboard input, though. These would work inside of text fields. Flash would probably still break them some of the time, but to deal with that I could install FlashBlock.

I really enjoy trying out new development tools. I think the next thing I’ll try out is a visual CSS editor. Any suggestions?

I just went to BIL. It was a fantastic conference. I met a lot of interesting people and saw a wide variety of talks. It was my first BIL. The first BIL was last year and about a third of the people at this BIL were there last year. Repeat attendance is always a good sign. It’s quite likely that I’ll go next year.

The first talk made the greatest impression on me. It was Brad Templeton of the Free Software Foundation talking about the problems with Cloud Computing. I always felt I was giving up flexibility and privacy by having most of my computing take place on an application service provider’s service, but this talk helped solidify that feeling. I’m going to see about getting my email under my control soon (I use GMail right now).

Of the rest of the talks, these ones really stood out:

  • Seasteading: how to homestead the high seas and why it will make politics work better by Patri Friedman – Really interesting idea. But could it actually work? After hearing the talk, I think it might.
  • California’s Water Crisis – What YOU can do! by Ryan Arroyo – As a future California resident and connoisseur of Californian produce this is really close to my heart. He gave lots of good water-saving tips. I asked him what the impact of the water shortage might be on farmers and he said that it looks like it will be tough for small farmers. I’d like to get involved in making sure the organizations that control the water supply are fair to small farmers.
  • Secrets of Social Influence (How to get a Date) by Francisco Dao – I finally got a good definition of what “hovering” is, in the context of flirting. I have done that in the past and will avoid doing it in the future.
  • The art of Conference Crashing by Chris Axton – It turns out that the easiest way to crash a conference is to volunteer. Go figure. Lots of great photos and stories, though.
  • What’s Funny about the Interwebs by Ben Huh of icanhascheezburger.com and failblog.org fame – Even though his work (taking user-generated content for free and slapping absurd quantities of ads on them) annoys me, it was great to hear him talk. And I can’t blame him too much. He talked about the lifecycle of a meme, using RickRolling as the example. Good stuff.
  • Color by Numbers – The Wonders of Algorithmic Art by Matthew Shultz – A fractal art demonstration using both visual tools and code.

This is just a sampling of the interesting talks I saw. I also missed some good talks. I can see many of them online, though.

I took this week off and am going to travel up the coast to San Francisco. I’m in Santa Monica right now. It’s been a wonderful vacation so far!

I set up vim to use enter to get out of insert mode. This prevents frequently having to reach for the escape key or use a multi-key combination. To insert a new line while in insert mode, I now use shift-enter.

An idea I had this morning is to make shift-enter swap the shift-enter and enter bindings. This way, if I’m in the mode of writing something new without manipulating text, I can push shift-enter once to enter a newline, then push enter for each additional newline, and push shift-enter when I’m done to get out of insert mode.
shift-enter

To implement it, I created a function that toggles the bindings, and added a call to the function to my bindings for <S-Enter>.

function ToggleEnterMappings()
  if mapcheck("<CR>", "i") == "<Esc>"
    iunmap <CR>
    inoremap <S-Enter> <C-o>:call ToggleEnterMappings()<CR><Esc>
  else
    inoremap <CR> <Esc>
    inoremap <S-Enter> <C-o>:call ToggleEnterMappings()<CR><CR>
  endif
endfunction
call ToggleEnterMappings()

Time will tell whether this is a good setup for me. I think if I do single-line inserts much more often than I do multi-line inserts it might.

After a friend recommended it, I gave Twidge a whirl. Twidge is a command-line microblogging client written in Haskell. It works with twitter and identi.ca.

Installing it on my mac was tricky at first, because I didn’t have instructions for installing it on Mac OS X, but once I figured out how to do it, it turned out to be really easy. I posted the installation instructions for OS X on the Twidge wiki.

So, how does it work? If you put twidge in your path, you can type twidge and it will provide a help screen. You can type twidge lscommands to get a list of commands. Of particular interest to someone who’s starting out is twidge setup, which asks for your username and password and puts them in ~/.twidgerc for later retrieval. Once it has your username and password, you can type twidge lsrecent for a list of recent updates by people you’re following, twidge lsreplies for a list of replies, and twidge update to post an update.

If -asu is specified on the command line to lsrecent, twidge will show all the updates since lsrecent was run. The -asu option has the same effect on lsreplies. In the Twidge HOWTO it shoes how to pipe lsrecent and lsreplies to less to enable checking all tweets with one command. I reversed the order so the replies would show up first, so I’ll see the replies even when I decide not to read all of the tweets. The command I put in ~/.bash_profile is here:

alias twidgecheck='(twidge lsreplies -asu; twidge lsrecent -asu) | less'

Now if I run twidgecheck, I can see all my updates. Nice! And once I’m done with them, I don’t have them showing up next time I turn to twidge. Update zero, if you will!

My main dislike with this system is that links are harder to visit with my terminal. If I was using the gnome terminal, I could just click them. Maybe I can find a way to make iTerm do that.