Home > Uncategorized > Textmate links, Firefox and Linux

Textmate links, Firefox and Linux

Various Ruby frameworks, including Ramaze and Merb, display error pages with TextMate links. While TextMate is Mac-only, Linux users can still use the links to launch Vim with the following steps.

1. Create /usr/local/bin/firefox-txmt with the following:

#!/usr/bin/env ruby

unless ARGV[0] =~ /^txmt://open?url=/ then
	puts "You probably want this called from firefox with a txmt url."
	exit 1
end

args = ARGV[0].split("://")

file = args[2].split("&")[0]
line = args[2].split("line=")[1]
line = "1" if line == "?"

`x-terminal-emulator -e vim #{file} +#{line}`

2. Create a key in about:config called network.protocol-handler.app.txmt, and set it’s value to firefox-txmt.

This tip came from Lindsay Holmwood’s blog. He also suggests these changes to .vimrc:

se cursorline
hi CursorLine term=none cterm=none ctermbg=1

Some more Vim stuff here.

Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.