How can I make sublime text 2 respond to txmt
url scheme in ubuntu? This has been possible in OSX through subl-handler and in Windows through SublimeProtocol.
Asked
Active
Viewed 1,598 times
6

Zuhaib Ali
- 206
2 Answers
8
[I see you have asked this question on both SO and AskUbuntu, so I answer here too, but don't know if one of these shouldn't be closed]
I asked me the same question today, seeing the txmt protocol with "better_errors" gem for Rails.
I search a long time but found nothing, so I tried to make it by myself.
I write an article and my blog, but I copy it here, for "future-proofness" :
Step 1
Create the file /usr/share/applications/sublime-handler.desktop
[Desktop Entry]
Name=Sublime Text 2 URL Handler
GenericName=Text Editor
Comment=Handle URL Scheme txmt://
Exec=/home/<your_user>/bin/sublime-handler %u
Terminal=false
Type=Application
MimeType=x-scheme-handler/txmt;
Icon=sublime-text-2
Categories=TextEditor;Development;Utility;
Name[en_US]=Sublime Text 2 URL Handler
Step 2: Update the MIME-types database
$ sudo update-desktop-database
Step 3: Create the ~/bin/sublime-handler file
#!/usr/bin/env bash
request=${1:23} # Delete the first 23 characters
request=${request//%2F//} # Replace %2F with /
request=${request/&line=/:} # Replace &line= with :
request=${request/&column=/:} # Replace &column= with :
sublime-text-2 $request # Launch ST2
Then make it executable : $ chmod +x sublime-handler
Step 4: Test a txmt:// file
If that dosen't work, say me, I'll try to help you.

Byscripts
- 245
1
Here is a utility made for this: https://github.com/algorich/sublime-url-handler
Download the latest release, unzip it, and run the following commands:
cd sublime-url-handler-master
bash install

BeastOfCaerbannog
- 14,585

nazar kuliyev
- 171
- 1
- 3
sublime-handler
on/bin/
folder and need to write that code? – xkeshav Aug 28 '14 at 10:15~
meanshome
directory.~/bin/sublime-handler
is exactly the same directory than/home/your_name/bin/sublime-handler
– Byscripts Aug 28 '14 at 14:57/bin
folder in~
– xkeshav Aug 29 '14 at 04:26