Lets kill that rat - five steps to keyboard efficiency

18 July 2007

As you know, I like using the terminal where possible, you type what you want and the computer does it. However, on the graphical side, I have become a bit lazy and started to use the mouse too much, moving from keyboard to mouse all the time surely cannot be healthy, and since I work and study using computers in the process, I am keen to avoid the risks of RSI.

So I need to kick my self in the butt to use the keyboard more. What follows is based on a GNOME-based Linux system, but I imagine it is more or less similar on other systems.

1. Remember the four main keys

Most of the time you can guess what to do and it will work. The following four common sense rules are well worth remembering:

  • Escape stops whatever you are doing, equivalent to moving and clicking away on something else with the mouse.
  • Enter usually chooses things.
  • Tab usually moves between things.
  • Cursor keys also tend to move or control elements.

2. Use the slider Luke

The slider is a quick and easy way to do things that would otherwise involve long trips with the mouse. The last one does not actually involve the slider but is a similarly dramatic action.

  • Alt + TAB - brings up the slider to select a program, this one is the key first step to freeing yourself from the rat. Keep holding on to ALT and keep pressing TAB until you have the program that you want.
  • Shift + Alt + TAB - brings up the slider to select a menu panel so you can click on short-cuts or whatever, this is less interesting.
  • Ctrl+Alt+ left/right cursor keys - brings up the slider to move around your workspaces.
  • Ctrl+Alt+d - minimises all the programs, thus giving you the desktop, pressing it again will bring everything back.

3. Alt is your best friend

Alt and the Function keys manage the windows. If you forget one of these, you can use Alt-space to bring up the window bar menu which has most of these listed.

  • Alt+F1 - opens the Gnome menu or whatever we are calling our top menu today.
  • Alt+F2 - allows you to run an application by typing its name.
  • Alt+F4 - closes the window, equivalent to clicking the X in the corner of the window.
  • Alt+F7 - moves the window, use the cursor keys to move the window, pressing other keys returns control back to normal.
  • Alt+F8 - resizes the window, use the cursor keys to move the resize, pressing other keys returns control back to normal.
  • Alt F9 - minimises the window.
  • Alt+F10 - maximises the window.

4. Apple Lisa forever

Now we can do window management using keys, the next step is the programs. The basic key commands for programs go back decades, most people who have been using computers for any length of time will know them. I will list them for completeness but the important thing is not just knowing them but rather the important thing is using them.

F10 Gets you to the main menu of whatever program you are in. Then use the cursor keys to get around. E.g. F10 then down or F10 then right then down. Shift-F10 opens the right-click menu of the program that you are using.

Most programs have at least the Apple Lisa/IBM editing commands, these normally involve the Control Key, for example:

  • Ctrl-S saves the file - the most important command in many programs, do regularly.
  • Ctrl-Z undos the last action.
  • Ctrl X / Ctrl C / Ctrl V - cut, copy, paste.
  • Ctrl F / Ctrl G - find, find next.
  • Ctrl O - opens an existing file.
  • Ctrl W / Ctrl-Shift-W - closes the current file / closes the whole program.

5. Take back the web

Web browsing is what has led to my overuse of the mouse. This is where the low-hanging fruit is and most beneficial to learn as these days most of us use the web more than any single desktop application. I use Epiphany and Firefox, I imagine most other browsers are similar. Most of the normal word- processing/text editing commands from part 4 will work here too. Other commands worth knowing:

  • Ctrl+T gets you a new tab.
  • When you are there, use Alt-home to get your homepage, or Ctrl-l **to type a link into the address bar. **Ctrl-K gets you to the search box in the right hand corner.
  • When you have a lot of tabs open, Alt-1 takes you to the first tab, while Alt-9 takes you to the last tab. Alt-2 through Alt-8 allow you select between the tabs in the centre.
  • Ctrl-W kills a tab, Ctrl-Shift-W or Alt+F4 (as above) to kill the window.
  • Ctr-R is refresh, Alt-cursor left/right can be used to go back to the beginning.

So if I get back into using these I will have reduced my use of the rat significantly. Of course there are things where the rat excels, imaging editing for example, but I find a knowledge of key commands works really helps there too. I use the GIMP imaging editor and knowing which key corresponds to which tool means I can keep the pointer on the image, rather than going back and forth to the menu.

As always if I have missed anything, or if you know a handy key combo, or anything else to share, have your say in the comments.

1 dbr says...

"Lets kill that rat" is the motto/tag-line/etc of a window manager "Ratpoison" - It's kind of like screen for X11 applications (but has better splitting capabilities, being an X11 window manager, rather than a terminal emulator) Everything in ratpoison can be doing via keyboard shortcuts (ctrl+t, c creates a new terminal window, ctrl+t [n/p] flicks though open windows, ctrl+t, ! gives you a temporary terminal box, that you can launch applications from, like firefox-bin) You can still use the mouse to interact with applications, but it's also completely possible to not have to use the mouse at all.

It's also small too (400kb), and requires nearly no configuration to get running - worth a try if you want to use the mouse less - Ben

Posted at 2:23 a.m. on July 18, 2007


2 dbr says...

Err, forgot the URL for ratpoison: http://www.nongnu.org/ratpoison/

Posted at 2:24 a.m. on July 18, 2007


3 Phill says...

In Firefox, you can use Alt + D to focus on the address bar... I prefer that to Ctrl + L because I can type it with one hand!

Posted at 8:12 a.m. on July 18, 2007


4 Zeth says...

@dbr good point! On my old laptop, I used ratpoison exclusively, it would run gnome-terminal and a web browser and that is all I needed really.

@Phill, that's a good one. I'm sure there are many ways to optimise us of the keybindings. I am trying to keep my fingers on the home row and touch type, rather than below the keyboard, which is a hard habit to break, so moving my hand to the mouse less will help in this quest.

Posted at 10:25 a.m. on July 18, 2007


5 Bug says...

  1. It's painful to get to the boxes in order to fill them on websites.

    Also for surfing. It is NOT a joy.

  2. F5 is refresh as well.

  3. F6 can get you to the URL bar as well.

Posted at 5:17 p.m. on July 18, 2007


6 Rolando says...

I prefer using Ion3 (http://modeemi.fi/~tuomov/ion/ ) , instead of ratpoison.

There is also a plugin for Firefox, called Mouseless browsing I think, that give numbers to links and text boxes, so that you don't have to tab your way to them (just type the number in the numpad and press enter). It can seem weird at first though.

Posted at 5:20 p.m. on July 18, 2007


7 anonymous says...

Maybe it's just my firefox, but Alt+Home is the homepage instead of Ctrl+Home.

Generally I do have one hand on the mouse, so two handers like Ctrl+I and Ctrl+K I tend to avoid. So I prefer F6 as well. And F6 and then Tab to go to the search field. Ctrl+T is the limit I can do with one hand, and next to Ctrl+W the most used :-)

Posted at 8:48 p.m. on July 18, 2007


8 Zeth says...

anonymous, You are quite right Alt+Home it is, I have corrected it accordingly.

Posted at 9:11 p.m. on July 18, 2007


9 Ryan says...

There's also Ctrl/Command+Shift+T for Firefox which reopens the tab you last closed. Very important. I'm quite the keyboard freak, and so none of these were new, but this one I've just mentioned was new to me, and it's saved the trouble of having to navigate through the history tab (which isn't so irritating, but wastes time).

Posted at 6:39 a.m. on July 24, 2007


10 Rediscover says...

For browsing, try Conkeror, either the chrome or the xul version http://conkeror.mozdev.org/ Mmm, driving a browser using those emacs keys, like C-v M-v C-u C-n even M-x print<tab> Leave the mouse in the drawer. For a window manager, I switched to WMII then dwm with mitch patches (before was Enlightenment and ratpoison).

Posted at 1:42 a.m. on February 15, 2008


What do you have to say?

Show Editing Help

About

Hello, my name is Zeth, I'll be your host here.

Command Line Warriors is about taking control of your own technology, it looks at our experiences of computing; especially using GNU/Linux, the Python programming language, the command-line and issues such as techno-ethics, best practices and whatever is cool now. If you take control of your technology then you are a Warrior too!

This site is your site too which means that you can contribute and get involved. You can leave comments using the facility provided. For me, the comments and discussions are by far the best part of the site. So please do have your say!

Latest Discussions

Zeth

November 29, 2009
Hi Jordan, yes that URL is gone now. I have a new contact form on this site.
Python CGI contact forms

Jordan

November 29, 2009
Zeth attention! Your form, http://zeth.me.uk/contact/, is not working The explorer says connecting ..but nothing happens Sorry for my poor English: I am Spanish Regards
Python CGI contact forms

Jordan

November 26, 2009
Sorry: tell me , not tellme (I'm spaniard) And http://zeth.me.uk/contact/ don't work
You got the touch, you got the power

David Jones

November 25, 2009
Your mad skillz are too l33t! for me. I specifically switched to Google Reader so that I could show people what blogs I read. But I couldn't work out how ...
How to find the fashionable blogs quickly

Brian R. Hickey

November 20, 2009
Symantec picked it up too.
How to bring down Internet Explorer with six words

Zeth

November 17, 2009
Thanks djm, I am the moose here. Christian, assuming one actually does Internationalise the countries, it should still work I guess, as the gettext stuff will happen before the list ...
Countries in Django

Phillip Temple

November 17, 2009
Good start, but: a) wouldn't I want None back rather than 'ZZ'? b) why not add a 'shortcut' boolean, then prepend flagged fields (plus usual '-----' separator) to the actual ...
Countries in Django

djm

November 17, 2009
Am I being a moose or did you mean: from whatever.countries import CountryField instead of from whatever.countries import CharField ? Good post though, cheers.
Countries in Django

Christian Joergensen

November 17, 2009
Wouldn't the ordering get messed up after i18n?
Countries in Django

Steve - Electronic Cigarettes Fan

November 17, 2009
Very well done. Is your blog just you writing? Nicely done, Steven.
Blogger vs Wordpress

vetetix

November 15, 2009
Sorry to bother you nearly two years after you wrote this blog article, but I can't manage to find how to modify an existing field. I am trying to change ...
Three Useful Python Bindings - ClamAV, Apt and Evolution

Manju

November 4, 2009
I am transferring some files using psftp to other device's FAT partition. But the filestamp of the file being transferred is modified to that of FAT device, after the transfer. ...
PuTTY Series: Using PSFTP

iki

November 2, 2009
or simpler: socket.gethostbyname_ex(socket.gethostname())[2]
How to find out your IP address in Python

iki

November 2, 2009
local_ip = set([ i[4][0] for i in socket.getaddrinfo(socket.gethostname(), None) if i[0] == 2 ])
How to find out your IP address in Python

Fred

November 2, 2009
testing rst ------------- - point 1
An Introduction to ReStructuredText

Ano

October 27, 2009
"You simply found the license of the StumbleUpon Toolbar for Internet Explorer." That's possible. I've got some more interesting information to add. Firstly, go to this page: https://addons.mozilla.org/en-US/firefox/addon/138 - this ...
Are your Firefox extensions proprietary software?

Ken

October 21, 2009
Stumbled in here at lunch. This is the best find of the week. Thanks.
Three classic command line tips

Jim

October 19, 2009
Thanks for the rtsp:// post - that's something that has been bugging me for a while!
Three classic command line tips

Zeth

October 18, 2009
Thanks for the comments guys. Great to see the all the gang are still here!
Three classic command line tips

Bubba

October 18, 2009
Is there any way psftp can return the true transfer rates oberved during the actual transfer?
PuTTY Series: Using PSFTP