(l)andscape: (a)lien

Categories: pedro | technical:hack


Sat Sep 22 15:36:03 firefox forwards and backwards navigation:

Thinkpad laptops have two special "forward" and "backward" keys above the typical left and right keys that are used for paging in applications like Firefox and other web browsers. Unfortunately, they don't work out of the box in Ubuntu like other buttons (like the volume knobs, suspend, etc.). I hate using Alt-Left/Right -- why make two keystrokes when I should be able to use one?

So I have been looking for a solution, but complicating this issue is that old solutions to this problem don't work in Firefox +v2.0, firefox extensions that advertise this ability are pre 2.0 as well, and Firefox remote tricks assigned to commands don't seem to work either (I think because of a vulnerability in Firefox remote? I'm not sure.)

Anyway, this site has a working howto, and it's really easy. The short version is to edit your ~/.Xmodmap to make back (keycode 234) and forwards (keycode 233) F19 and F20, and then edit browser.xul to use that instead of the Alt-Arrow combos. For Ubuntu anyway one thing different from the howto is that browser.xul is already unzipped in /usr/share/firefox/chrome/ ... etc, not in your homedir or .mozilla, etc. Just edit it and save it; you don't need to re-package chrome or whatever although you do need to restart Firefox. This material should get updated in the ThinkWiki and other sites... but I'm not going to do it.

Incidentally, the "back" and "forward" buttons on the new Microsoft Natural Ergonomic Keyboard 4000 use the same keycodes, so if you have one attached to your Thinkpad like me, this is a two-for-one deal.

Update: You can leave the old hotkeys in and just add the new ones to keep the old "alt-arrow" mapping and add the new thinkpad arrows if you want! Beaujolais!

Thu Sep 06 09:37:23 cool screen tricks:

I used to do this one all the time, but recently forgot it. I had to look it back up again.

Anyway, when you're using screen (which is all the time, right?) and you wish that a particular screen was at a different index (like let's say when you're running some job that you don't want to start over) you can just reassign its index like this:

<escape>:number n

... where escape is probably control-a (aka C-a in screen lingo) and n is the numeric index you'd like the screen to be at.

Yes, it's just that simple!

Another cool screen trick that I'm going to throw in for FREE (if you call in the next 30 seconds) is nesting screens. There are two ways to do this:

1. Set a unique escape in each screen. You can do this by setting a new escape in one of the screens:

<escape>:escape ^Xx

... to set the escape to control-x in that screen. Then you can pick up the screen inside another screen and use the appropriate escape sequence in each screen context.

2. In this method, you don't change the escape sequences at all, but you just hit the sequence twice to "drill down" into a nested screen. So for example, if you have a screen within a screen, and within the nested screen you want to change to the next window, type:

<escape><escape>n

... where merely typing

<escape>n

... would just change the screen in the "top level" screen.

At these prices you can't say no!

Mon Aug 27 15:24:04 cool vim trick:

You can split windows in vim and keep multiple files open. This isn't usually that interesting to me because I use screen for everything and memory usage isn't really an issue.

What *is* useful is that you can have two views into the same file -- so if you want to reference something way up top but you're working way down at the bottom, you can split your view. Here's how:

:sp (splits window) CTRL-W up (move up) CTRL-W down (move down) :q (closes this window)

You can find a lot more info and additional commands if you search for "vim split window" or somesuch.

Pretty rad!

T Sun Apr 22 15:35:32 happy birthdays / encrypted Ubuntu:

Two birthdays to celebrate: One, The Tastytronic Diner is now in its 5th year. And two, Dumont the IO Tower Guardian, keeper of the clickolinko is now in his 7th year of operation. We figured out his birthday -- 950341551 (Sat, 12 Feb 2000 07:45:51 GMT) -- today after never having known it.

I also recently found Encrypted Filesystem HOWTO for Dapper which I'm using to build an encrypted backup server for flynn. It seems to work.

T Thu Apr 05 20:07:57 cool vim trick:

So, I've seen vim configured to open and place the cursor in the last cursor position in that file before closing, and at first I thought it was annoying. Then I started to like it. Now I miss it. It was bittersweet though; I thought I would want it enabled in my .vimrc, but would I find myself getting annoyed by it? Intrigued, I went looking for an answer, and instead found that the command '" (that's a single quote followed by a ") jumps to that position -- essentially, when you close vim, it sets a mark for that position to the character " and, as we all know, ' is the "jump to" command. So now I don't have to have it as a default -- but any time I want it, it's there.

T Sat Mar 10 10:37:12 .ssh/config:

Set ssh defaults for different hosts.

T Mon Mar 05 16:30:48 gnome-terminal:

control-'-' and control-'+' increase and decrease the font size in the active window. Pretty cool!

I'm one of those people who thinks that it should probably be control-'=' so that I don't have to do control-shift-'='... but maybe that's just me. It seems a little pedantic to make people press shift.

T Sun Mar 04 14:05:14 hot vim tip sandwich (au jus):

vim has a cool "delete-from-here-to" feature. In command mode, put your cursor where you want to start deleting. Then, type 'd/n', where n is a regex describing where you want to stop deleting. vim should show you where you are deleting to, either by highlighting, or by moving the cursor. When you're pleased with your regex, hit enter. Bam!


[Main]

Unless otherwise noted, all content licensed by Peter A. H. Peterson
under a Creative Commons License.