Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature enhancement request: Change color scheme depending on host? #2

Open
TMorville opened this issue Apr 17, 2018 · 4 comments
Open

Comments

@TMorville
Copy link

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.

@randy3k
Copy link
Owner

randy3k commented Apr 17, 2018

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

@TMorville
Copy link
Author

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

@randy3k
Copy link
Owner

randy3k commented Apr 18, 2018

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

@Phidica
Copy link

Phidica commented Jul 7, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants