Visual Studio keyboard bindings and text editor requests

I recently started experimenting with emacs on the many suggestions of Steve Yegge. Unfortunately, just getting up to speed in emacs (i.e. working as quickly as I do in Visual Studio or even vim) was taking a long time and when time is short, as it is during milestone development here at Microsoft, that’s not the best way to spend it. So I’m putting off that experiment until work slows down, or until my parental leave in January. In making the decision to stick with VS for the next few months of coding, though, I definitely want to improve how I use the text editor and as I began working to do that I ran across this post by Noah Coad. So I thought I’d respond to Noah and share some of the things I’m doing to improve my keyboard use (and therefore, speed) during development.

My familiarity with the vim and emacs commands has led me to seek a keyboarding compromise. I love vim’s ability to navigate very easily on the home row keys. But I like the fact that emacs doesn’t have two separate “modes”, command and insertion. I always get thrown off in vi because of that. So my navigation keys are basically the vi navigation keys while holding down the Ctrl key. I’ve also adopted a hybrid of the emacs convention of using Alt to switch from characters to words, lines to sentences etc. So Ctrl-Alt-J moves my down a page, etc. And then, I like the windows convention of holding down Shift while nagivating to select text, so I’ve added mappings to do that, e.g. Ctrl-Shift-K to select up a line. I’ve also added some other navigation keys that follow this same pattern, such as Ctrl-0 to go home. Of course, I’ve also remapped the commands that are at those bindings by default to other bindings depending on how often I use them.

So far this seems to be going well. I’m still learning these keyboard shortcuts and that’s taking a little bit of re-education, but I feel faster than when I use the mouse, which is a good baseline to start from.

Now to respond to Noah. I am now trying to use visual studio for more of my text editing needs, and customizing it more so that I can. As I’ve started doing this I’ve been impressed at how much power is there that I didn’t know about, but also frustrated by the little things that are possible but not easy to do. Searching, replacing, and regular expressions is an area that could definitely stand to be improved. Opening files from the explorer or from visual studio into new instances easily would be nice (an SDI type mode). One thing that would be useful is to have keyboard mappings that can be applied and then removed easily. This would be similar to modes in other text editors, but allow for some specific behaviors in certain cases.

Comments are closed.