Archive for --
No click

So I'm running Fedora 13 on my machine. I recently upgraded to X.org 1.8.0 and two bugs have appeared since updating from xorg-x11-server-Xorg-1.7.99.902-3.20100319.fc13.i686.

No working mouse buttons has created an interesting situation where I am forced to use the keyboard for everything. It hasn't really changed much. I really miss the X selection buffer and the ability to click links in urxvt. Bugzilla is also an interesting adventure to navigate without a mouse. Luckily uzbl has a plugin to tag links with letters (similar to Konqueror's "Access Keys"). Copy/paste is done using screen's copy buffer (^A{ to go into copy mode, space to set a start and end point for the copy (with Vim-like movement keys) and } to do the copy itself. The ^A} command then replays the copied keys into the current terminal (being in Insert mode in Vim is helpful).

Conversion

Yesterday I got a patch upstreamed to Firmant that handles static pages that are written in reStructuredText. The "About" page in the first sidebar box on the right is managed this way. This will allow me to manage my project websites using Firmant as well. These should be coming up as I get to work on them. In addition I should be getting an actual homepage rather than the nginx default.

After this work, I worked on converting some of my old posts from the format in the database to reStructuredText. One of the more annoying things to convert are the links. After manually doing the first two of the posts, I recorded a macro within Vim to do this for me. For anyone else that's converting over to Firmant from an HTML-based blog format, this will be extremely helpful:

/<a<CR>v8ld"udt"2s`<ESC>/<\/a<CR>4s <>`_<ESC>2h"uP

Step by step, here is what is happening:

  • /<a<CR> --- Search for the opening tag for an anchor.
  • v8ld --- Visually select 8 characters to the right and delete them (this could be condensed to d8l). This requires that you have Vim set to be able to go to the next line when moving right or left. If you do not have this set, d8gl is what you need.
  • "udt" --- Delete text until the next " character and place it in the u buffer.
  • 2s`<ESC> --- Replace the next two characters (the "> of the anchor tag) with a single ` and return to normal mode.
  • /<\/a<CR> --- Search for the end tag of the anchor.
  • 4s <>`_<ESC> --- Replace the next four characters (the complete end tag) with <>`_ and return to normal mode.
  • 2h"uP --- Move left two characters and paste the u buffer before the current position.

Once this is done to convert all of the links, I remove any escaping characters (usually single quotes from the database dump) and reflow all of the paragraphs with what is probably my favorite Vim command: vipgq. This means "visually select the paragraph I am in (vip) and reformat it to fit within my current textwidth setting (gq)". I use a textwidth of 78 personally. Hope this helps!