2010.09.23

10 Specific Ways to Improve Your Productivity With Emacs

emacs.png

I was re-reading an old post by Steve Yegge about productivity tips for using Emacs, and I wanted to comment on a few of them, but I was not able to find a way to leave a comment or email him. That combined with the fact that I haven't done a blog entry in over a year, I thought I should blog my comments here.

If you use Emacs (and you should), you owe it to yourself to read his post. He does a very good job explaining why Emacs is better at certain [most] tasks and how to configure it for an even better experience.

10 Specific Ways to Improve Your Productivity With Emacs

As I read this I realized that I had incorporated a lot of his recommendations already. Some I had not implemented, others I had tried and reversed (as noted in my comments inside my dot-emacs files). I've listed his sections that I have comments about.

Item 1: Swap Caps-Lock and Control

This time I am going to try to stick with using Caps_Lock as Control. Since I mostly use Ubuntu Linux setting up my .xmodmap files was pretty simple to do. I will be sure to try his regedit trick on Windows when I get a chance.

Item 2: Invoke M-x without the Alt key

I had this switched off because I was using the C-xC-m key for starting Mingus, but I'm going to try the keybindings he recommends.

Item 3: Prefer backward-kill-word over Backspace

I find it hard to switch finger-memory modes when switching between Emacs' cut/copy/paste bindings and the standard CTRL-X/C/V ones that so many other applications use. Because of this, I use cua-mode. It allows me to keep the Emacs functionality of those keys while still being able to use them as needed. Having said this, I still want the original Emacs cut binding C-w to work as expected.

Since the kill-region command should only be called when a region has been selected, I wrote some code to solve this issue for me. Using the following code will do-the-right-thing when you press C-w:

(defun kill-region-or-word ()
  "Call `kill-region' or `backward-kill-word' depending on
whether or not a region is selected."
  (interactive)
  (if (and transient-mark-mode mark-active)
      (kill-region (point) (mark))
    (backward-kill-word 1)))
(global-set-key "\C-w" 'kill-region-or-word)
Dialog Boxes: The Root of All Evil

Just had to say that I completely agree.

Item 7: Lose the UI

Being nitpicky here but when should be used instead of if in the following code:

(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))

Like so:

(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
Keyboard Macros

As mentioned in the comments section, after you've created a keyboard macro with C-x( and finished it with C-x), and then used it once via C-xe, you can then repeat it by just pressing e.

That's about it for my comments. I hope Steve writes more articles on this topic and finishes his remaining 40 tips.

For more interesting Emacs sites see my previous blog entry about this topic.

If you don't use emacs, you're a pathetic, mewling, masochistic weakling and I can't be bothered to convert you.

-— Ron Echeverri


2008.01.29

How to Get Started Learning Emacs

emacs.png

I do realize that I'm probably quite biased on the topic of editors, but be that as it may, Emacs is simply the best editor, IDE, environment, platform, lifestyle, etc. there is. And it's high time you learned how to use it.

First a quick aside… I used vi and vim for 10 years or so before I finally decided to bite the bullet and take the time to learn Emacs. It probably took me 6 months of playing with Emacs to really get comfortable with it. Hopefully these suggestions will help lessen that amount of time for others.

I'm assuming that you can figure out how to find and install Emacs for your system. You may read how to obtain Emacs from the GNU Emacs site.

Here are some good sites for more information about Emacs:

The problem with the GNU coding standards is they ASSUME that everyone in the world uses emacs. If that were the case, free software would die because we would all have wrist problems like RMS by now and no longer be able to code.

– Knghtbrd


2007.06.04

First Post

dead-end.png

Every blog has to have one. This is just a marker for when I finally added blogging to my site.

My name is Kyle Sherman and this is my technically inclined blog that will primarily focus on computer science topics along with other things I care about.

I'm using Muse in Emacs to write and publish this entire site. I will be blogging about the specifics of how I do this and my setup in the future.

For some general information about this site and my contact information see my http://nullman.net/about/ page.

Cheers!

– Kyle Sherman

Linux is as much about being Communist, as is the phrase, "of the people, by the people, and for the people".