RemoteSubl
RemoteSubl copied to clipboard
Feature enhancement request: Change color scheme depending on host?
I often have 2-3 different sessions with Sublime + iTerm2 open. Using a simple batch script, I have set my iTerm2 to change colours (by activating a different iTerm user) when I ssh into a different host.
I was wondering if the same could be done for RemoteSubl? Such that when I open something from a specific host/ip/port, then Sublime opens in a different colour scheme, depending on the host/ip/port.
You should be able to write a simple plugin to change color scheme based on view.settings().get('remote_subl.host')
This minimal implementation works. Any suggestions on how to run the plug-in every time I open something with remote_subl?
import sublime_plugin
class ExampleCommand(sublime_plugin.TextCommand):
def run(self, view):
view = self.view
host = view.settings().get('remote_subl.host', None)
print(host)
if host:
view.settings().set(
'color_scheme',
'Packages/Color Scheme - Default/Mariana.tmTheme')
print(view.settings().get('color_scheme'))
if host is None:
view.settings().set(
'color_scheme',
'Packages/Color Scheme - Default/Monokai.tmTheme')
print(view.settings().get('color_scheme'))
You could use an EventListener
to tell Sublime to apply a different color scheme when remote_subl.host
is present.
Hi @randy3k, would you accept a PR to incorporate this functionality directly into RemoteSubl?