I recently saw a reference to Tim Visher’s VimGolf in Emacs videos on one of my feeds. It looked interesting so I hopped over to take a look. VimGolf is a site that poses editing challenges that are supposed to be done in Vim. As with golf, the winners are those with the lowest number of (key)strokes. Visher uses these challenges as a basis for videos that highlight various Emacs techniques. Why should Vim users have all the fun, after all?
I’ve watched a couple of the videos and already learned something very useful. I’m not sure what people who grew up with computers are doing but when I learned to type in high school—on a typewriter—we were taught to put two spaces after the period at the end of a sentence. This made sense with the monospaced typescript that typewriters produced but is incorrect for proportional fonts. After reading this rant on the practice I started using just a single space. Then one day I read that I could move forward and backward by sentences using 【Meta+a】 and 【Meta+e】. The problem was that it seemed to move by paragraphs instead. Moving by sentences isn’t something I do a lot so I just shrugged my shoulders and moved on.
During one of Visher’s videos, I learned that by default Emacs uses a period and two spaces to delimit sentences. That was why moving by sentence wasn’t working for me. The solution to the problem is trivial: simply put
(setq sentence-end-double-space nil) ;period single space ends sentence
in your .emacs
or init.el
file. After doing that, moving by sentences worked correctly.
I really recommend these videos. They’re entertaining and full of things that you might not have known. The later videos show the keystrokes on the screen but the earlier ones don’t so you have to pay attention to what Visher is saying. Still, it’s worth the effort. I’m sure I’ll be passing on other tidbits as I learn them.