Skip to content

Instantly share code, notes, and snippets.

@jtsagata
Last active August 29, 2015 13:59
Show Gist options
  • Save jtsagata/10843329 to your computer and use it in GitHub Desktop.
Save jtsagata/10843329 to your computer and use it in GitHub Desktop.
Sublime Text 3, livereload, railsPanel, better_errors, linux
#!/bin/bash
echo "Installing Sublime text handler"
sudo cp sublime-handler /usr/local/bin
sudo cp sublime-handler.desktop /usr/share/applications/
echo "Updating desktop database"
sudo update-desktop-database
cat <<THE_END
Not done yet!
1. Install the following chrome extensions
LiveReload https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
RailsPanel https://chrome.google.com/webstore/detSail/railspanel/gjpfobpafnhjhbajcjgccbbdofdckggg
2. Install Sublime text and go to Preferences -> Settings - User
Add a line with:
"atomic_save": false,
THE_END
#! /usr/bin/env ruby
require 'uri'
require 'cgi'
full_path = ARGV[0]
if full_path
uri = URI::parse(full_path)
if uri.query
params = CGI::parse(uri.query)
line = params["line"][0]
col = params["column"][0]
file = params["url"][0].sub('file://','')
file_path ="#{file}:#{line}:#{col}"
`/opt/sublime_text_3/sublime_text #{file_path}`
end
end
[Desktop Entry]
Name=Sublime Text 3 URL Handler
GenericName=Text Editor
Comment=Handle URL Scheme txmt://
Exec=/usr/local/bin/sublime-handler %u
Terminal=false
Type=Application
MimeType=x-scheme-handler/txmt;
Icon=sublime-text-3
Categories=TextEditor;Development;Utility;
Name[en_US]=Sublime Text 3 URL Handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment