Home Download Buy Blog Forum Support

Prevent closing single quote in certain syntaxes

Prevent closing single quote in certain syntaxes

Postby SelectricSimian on Tue Feb 12, 2013 12:13 pm

I'm writing my own programming language, and I'm using Sublime Text to write the code samples/tests for it. I'm more or less fine with plain text mode (I don't care too much about having my own custom syntax highlighting for the time being), but there is one issue. My language makes extensive use of single quotes as *prefixes* for identifiers to prevent them from being evaluated.
Code: Select all
'x <- y
is an assignment statement, for example, and
Code: Select all
def: 'my function, args... {body...}
is a function definition. The problem is that sublime text automatically adds a closing quote, which is incorrect in my language. I'd imagine this would be a problem for lisp users writing in Sublime Text 2 as well.

How would I prevent sublime text 2 from inserting these closing delimiters? Preferably I would like a way to put it in a custom syntax, because I value the auto-closed quotes in every other language.

As far as I can tell Sublime Text does not have capabilities to modify opening and closing delimiters for languages, because otherwise I'd imagine ruby would enable it for back ticks, and lisp would disable it for single quotes. I'm still hoping there's an obscure setting somewhere that does exactly what I want, however. If this exists, where would I find it?
SelectricSimian
 
Posts: 1
Joined: Tue Feb 12, 2013 12:00 pm

Re: Prevent closing single quote in certain syntaxes

Postby adzenith on Wed Feb 13, 2013 3:20 am

I seem to recall you can create language-specific settings, and so just turn off single-quote matching for your language.
I think this may require creating a syntax file, though, but it could probably be close to blank.
adzenith
 
Posts: 1214
Joined: Mon Oct 19, 2009 9:12 pm

Re: Prevent closing single quote in certain syntaxes

Postby john.croisant on Sun Mar 24, 2013 6:30 pm

I'm in the same boat. I would like to use Sublime Text to edit Lisp/Scheme/Clojure code, and the auto-inserted single quote is very distracting.

Has anyone discovered how to do this, or can point me in the right direction for how this might be done?
john.croisant
 
Posts: 1
Joined: Sun Mar 24, 2013 6:25 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 19 guests