Okay. I'm working on some syntax-highlighting and such for a language which, effectively, has no strings. Or rather, no quoted strings: everything is a string or a list or whatever, depending on its context.
The problem? One of the most irritating things is when I type a ' or a ", it adds a doubled one there. I want to disable that for just one language... but not all... because when i'm doing Python or C++ programming, I quite like that feature.
Is there anyway to do that?
Thanks!
--Ix
On 21/09/2005, at 19.23, IxokaI wrote:
The problem? One of the most irritating things is when I type a ' or a ", it adds a doubled one there. I want to disable that for just one language... but not all... because when i'm doing Python or C++ programming, I quite like that feature.
Is there anyway to do that?
Yes -- go to the bundle editor, for your language bundle add a new preferences item (using the + button) and insert:
smartTypingPairs = ( ( "(", ")" ), ( "{", "}" ), ( "[", "]" ), ( "“", "”" ), ( "`", "`" ), );
That gives you type-pairing for the normal characters except " and '. Set the scope for this preferences item to source.«your language».
Typing pairs can also be set for more specific scopes, e.g. ' is already removed from strings and comments in sources (and text, but present inside <tags> in HTML).
On Wed, Sep 21, at 12:41 PM, Allan Odgaard wrote:
Yes -- go to the bundle editor, for your language bundle add a new preferences item (using the + button) and insert:
smartTypingPairs = ( ( "(", ")" ), ( "{", "}" ), ( "[", "]" ), ( "“", "”" ), ( "`", "`" ), );
That gives you type-pairing for the normal characters except " and '. Set the scope for this preferences item to source.«your language».
Typing pairs can also be set for more specific scopes, e.g. ' is already removed from strings and comments in sources (and text, but present inside <tags> in HTML).
Could I have an example of this?
Gerd
That was an example he gave :) Worked great... I have a Preferences item in my bundle which contains that text, and on the bottom, it says Scope = "source.mushcode". And my language defines its scope to be source.mushcode, so... I just took off the quotes, and woila...
On 9/21/05, Gerd Knops gerti@bitart.com wrote:
On Wed, Sep 21, at 12:41 PM, Allan Odgaard wrote:
Yes -- go to the bundle editor, for your language bundle add a new preferences item (using the + button) and insert:
smartTypingPairs = ( ( "(", ")" ), ( "{", "}" ), ( "[", "]" ), ( """, """ ), ( "`", "`" ), );
That gives you type-pairing for the normal characters except " and '. Set the scope for this preferences item to source.«your language».
Typing pairs can also be set for more specific scopes, e.g. ' is already removed from strings and comments in sources (and text, but present inside <tags> in HTML).
Could I have an example of this?
Gerd ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 21-09-2005 19:53, Gerd Knops wrote:
smartTypingPairs = ( ( "(", ")" ), ( "{", "}" ), ( "[", "]" ), ( "“", "”" ), ( "`", "`" ), );
Typing pairs can also be set for more specific scopes, e.g. ' is already removed from strings and comments in sources (and text, but present inside <tags> in HTML).
Could I have an example of this?
- Open a HTML document and enter a string. - Place caret inside said string and hit shift-ctrl-P, this shows the scope for that string - Goto Preference settings (ctrl-opt-cmd-L and select preferences) - Add new preference, copy code from above and adapt if necessary - Add the scope from what you found in step 2
Voila, now you have a autocompletion setting that is only used inside HTML strings.
Jeroen.
On Sep 21, 2005, at 2:01 PM, Jeroen van der Ham wrote:
- Open a HTML document and enter a string.
- Place caret inside said string and hit shift-ctrl-P, this shows
the scope for that string
- Goto Preference settings (ctrl-opt-cmd-L and select preferences)
- Add new preference, copy code from above and adapt if necessary
- Add the scope from what you found in step 2
Newbie question: where does one find sweet keystrokes like these? Thanks _matt