RemoteSubl icon indicating copy to clipboard operation
RemoteSubl copied to clipboard

Feature enhancement request: Change color scheme depending on host?

Open TMorville opened this issue 6 years ago • 4 comments

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.

TMorville avatar Apr 17 '18 14:04 TMorville

You should be able to write a simple plugin to change color scheme based on view.settings().get('remote_subl.host')

randy3k avatar Apr 17 '18 14:04 randy3k

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'))

TMorville avatar Apr 18 '18 11:04 TMorville

You could use an EventListener to tell Sublime to apply a different color scheme when remote_subl.host is present.

randy3k avatar Apr 18 '18 15:04 randy3k

Hi @randy3k, would you accept a PR to incorporate this functionality directly into RemoteSubl?

Phidica avatar Jul 07 '22 02:07 Phidica