Closed videoMonkey closed 11 years ago
The <, > and ? keys are closer to each other, and it is a personal preference of mine. I made this package out of necessity because other EJS tmLanguage files broke under sublime's default set of bundles. I would very much like to support % and ? variations, but I'm unsure how this would work in a tmLanguage file. Any suggestions would greatly be appreciated, I would very much like to maintain this syntax definition for the entire sublime text community.
One idea would be to allow an either-or approach. That is, the syntax definition would recognize <? and ?> or <% and %>, but this would mean event <? and %> or <% and ?> would be defined as valid EJS.
It would be nice to do an either or approach, or to be able to allow the user to define what their tags look like, because some will probably want {{ }} tags. At any rate, I want to build a keyboard shortcut that works that it doesn't really matter what the key distance is to type the tags.
I'm not sure how this might work. Is it even possible to dynamically change the tmLanguage file based on what open and closing tags the user defines?
I am not entirely certain how to do it, but I think a sublime text environment variable could be set and then accessed by the snippet. I don't have time to work on it this week. I am a bit of a sublime text noob, but I'll try and take a look next week.
Likewise, I'm a noob to ST and I'm super busy this week; it's the 4th of july, so yeah. I had some talks on the IRC channel, but nothing really figured out yet. I'll keep this issue updated with whatever information I find.
+1 for this request.
+1 for this request.
+1 for this request.
+1 for this request.
+1
This was annoying me as well. I ended up uninstalling this EJS package and setting all .ejs files to open with HTML (Rails). You can do this by opening an .ejs file, go to View > Syntax > Open all with current extension as...
Looks much better, but may not be perfect.
For those of you wanting to use this convenient .tmLanguage with the default tags, I think making the change for yourself isn't too bad (seems to work for me).
Change lines 579: <string><\?=?-?</string>
to: <string><%=?-?</string>
and 589: <string>\?></string>
to: <string>%></string>
Now, as to having that be some kind of setting, lost on how to do that one.
Thanks, stilenx. I should have posted these instructions; I'll put them in the readme for now.
As for making it a setting, I'm lost on this too. I'm not a python developer and I am having trouble understanding the environment that sublime's plugins run in. If anyone has any suggestion and experience with sublime text plugin API, please let me know what is possible. I tried asking around on forums and IRC, but had no luck.
If I find anything I'll let you know. Also not a python developer, so no promises. Also see my edit, I accidentally copy pasted the actual strings from the line wrong (or github ate them).
Use a to start code and another to end it;
like thiswould be come
like this`. You can edit the comment with this in mind.
Thanks
I don't have any idea how to make this a preference, but here is a repository you can install that uses % rather than ?
I fixed this issue by adding two options in the command palette. Please read the new README on the github repo for reference on how to switch between the two different syntaxes.
I should first thank you for taking the initiative to create an EJS package for sublime, thanks, but I have to ask why did you choose <? ?> when the ejs page clearly states that <% %> is the default tag form. I would prefer it to be like that.