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

Custom Prefixes #13

Open
stell opened this issue Aug 7, 2015 · 2 comments
Open

Custom Prefixes #13

stell opened this issue Aug 7, 2015 · 2 comments

Comments

@stell
Copy link

stell commented Aug 7, 2015

UIkit support custom prefixes for some time now. How about supporting them here?
"uk"-autocomplete does not work for us...:(

@diomed
Copy link

diomed commented Feb 26, 2017

I agree. Can something be done about this, or can you at least
tell us what needs to be changed in order to have this right @florianletsch ?

@floriandotpy
Copy link
Contributor

floriandotpy commented Feb 27, 2017

Here is a quick solution to change the plugin for a custom prefix. For the future, I think we should implement this as a setting that is easily changed and preserved during updates. I will put this in our TODO list. If anyone else finds the time: Feel free to send a pull request.

Here's a quick and dirty way.

  1. Uninstall the plugin using Package Control.

  2. Install the plugin from source:

    cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages
    git clone --branch 1.13.0 [email protected]:uikit/uikit-sublime.git
  3. Open main.py and overwrite the initmethod so that it looks as follows. Make sure to keep the correct indentation (4 spaces!). This is Python, after all. ;)

    def __init__(self):
    
        def prefix(s):
            return s.replace('uk-', 'xyz-')
        self.class_completions = [("%s \tUIkit class" % prefix(s), prefix(s)) for s in classes]
        self.data_completions = [("%s \t UIkit attribute" % prefix(s), "%s=\"$1\"" % prefix(s)) for s in attributes]

EDIT: Oh, and remember to replace xyz- with your own prefix in that snippet above.

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