Sublime Forum

Automatically close "Tags"

#1

Hi,
I have here sort of strange script language. I would like to have a similar feature like the auto-close tags in HTML.
For instance, the language I am using has some “environments” which can start with

start_config
start_data
start_whatever

and I would like to have Sublime Text to append automatically the

end_config
end_data
end_whatever

tags whenever I type start_* and hit enter. Of course I could implement a snippet for that, but there are a lot of such environments so I would need to write a lot of snippets. However, I think there is a way using an autocomplete or so. A simple plugin would also do the job, but I don’t know exactly where to start. Any ideas?

Thanks in advance!

0 Likes

#2

Based on what you have said it sounds like you might benefit from creating a language syntax definition for this script language. http://sublimetext.info/docs/en/extensibility/syntaxdefs.html and http://docs.sublimetext.info/en/latest/extensibility/syntaxdefs.html have information about syntax definitions.

0 Likes