Sublime Forum

Prevent closing single quote in certain syntaxes

#1

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. 'x <- y is an assignment statement, for example, and 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?

0 Likes

#2

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.

0 Likes

#3

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?

0 Likes