Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A new syntax definition format for Sublime (sublimetext.com)
99 points by benesch on April 8, 2015 | hide | past | favorite | 25 comments


This looks great. A lot of Sublime Text syntax definitions are buggy and/or out of date, in part due to the awfully tedious task of maintaining tmLanguage syntax files.

Hopefully this will be combined with putting all the official sublime text syntax definitions on github so there can be more continuous improvements coming from the large community.

Or just stop including syntax definitions with the editor entirely, make people use packages/plugins (though this is less likely to happen, Sublime is popular in part because it works so well out of the box).


Gave it 30 seconds (this is not something I use currently.)

Seems easy to understand.

And most of all I came to say glad to see Sublime Text moving forward again.


I am very happy with Sublime. The only thing I really wish for is AST based autocomplete and code jumps. I know it's slow and won't really work for JavaScript but other editors did something about it. Specially with ES6, it's easier to resolve module imports.


This is much much better than the hassle I had to go through building Sublime syntax support for a language a few months ago. Glad to see the Sublime team are making themselves competitive!


Team? I think it's just one dude.


One entire dude? It seems like he works on it for about an hour a week.


Nice! I just returned to Sublime after getting fed up with Atom's performance and stability issues, and I can't believe it took me this long to switch back.

One thing that bothers me, maybe more than it should-- On OS X, I like opening directories for editing by using the open command:

open [folder] -a Sublime\ Text

This is great, but I hate that Sublime Text has a long, two-word name, requiring me to escape the space or use quotes (it was even worse when I had to type Sublime\ Text\ 2).

I've tried aliasing and symlinking "sublime" as a shortcut, but since the open command uses Launch Services to find the application name, none of that shell trickery works. This is the only thing preventing complete text editor zen :(


Have you tried this? https://www.sublimetext.com/docs/2/osx_command_line.html Works flawlessly here on Sublime 3 on OS X 10.10.

And then

    $ subl .
to open the current folder.


Ha! After complaining I figured I'd give one more shot at solving this and I came across that same technique. Then I came back here to update my post and of course people were already giving me that advice.

Zen achieved.


Further zen can be achieved by aliasing `e` to `subl`.


I have a personal setup like that:

* e is aliased to `emacs` (I use Emacs on command line and Sublime Text using a GUI and projects, so I use `subl` command rarely). * g is aliased to `git`. * z is a glorious cd command: https://github.com/rupa/z

Besides them I use `rsub` command when editing files on a remote server, which is `rmate` for Sublime Text.

Tip for zsh users: With zsh's history-beginning-search-* commands I can write only a prefix to find a command in history. E.g. If I already typed `rsub user_management/forms.py` before and want to open that file, I type `rsub u` and press up arrow a few times till I get to the result I want.


Just associate .txt files with Sublime Text and then you can type 'open -t {file}' or 'open -t {directory}' to open in Sublime Text. I'll often do 'open -t .' to open the current directory, then CMD+P to open any file in the directory hierarchy.


  function open_st2 {
    open $1 -a Sublime\ Text
  }


Might be a version 3 thing, but I can just type subl [folder].


Nice. Respect is likely due to Guillermo; this looks derived from his PackageDev project. The push/pop context action looks better than the begin/end region system, though maybe only a bit in convenience.


This looks awesome. But is there a technical reason why it's using YAML when virtually every other sublime specific config file is using JSON?


How does atom handle this, just textmate language files?


So pretty much the same thing we had before, except instead of writing JSON you write YAML


previously language syntax used TextMates xml based tmLanguage files for syntax highlighting.

Example: https://github.com/Benvie/JavaScriptNext.tmLanguage/blob/mas...


Well, sure it 'uses" xml bases representation, but you can actually write the syntax in JSON and Sublime Text will compile it down to XML.

Example: https://github.com/Nessphoro/sublimeassembly/blob/master/Ass...

Output: https://github.com/Nessphoro/sublimeassembly/blob/master/Ass...


https://github.com/SublimeText/AAAPackageDev lets you create it with YAML. If nothing else, not having to escape and quote your regular expressions seems like a winning proposition.


How? What do you run to write out XML to disk?

I suspect you're confusing what some juiced-up workflow makes possible vs. how stock Sublime works.


Pushing and popping a context is a pretty big deal.


Is Sublime back in active development? Last I had heard, it basically hadn't been updated since 2013.


There have been a bunch of new builds recently: http://www.sublimetext.com/3dev




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: