Hi there,
I like very much the ability to select a word via ⌃W, then typing a quote to wrap this word into. How do I add a custom quote on my own ? I would like to be able to do this with the french quotes «...»
Thanks in advance
On Aug 30, 2006, at 1:03 PM, guerom00 wrote:
Hi there,
I like very much the ability to select a word via ⌃W, then typing a quote to wrap this word into. How do I add a custom quote on my own ? I would like to be able to do this with the french quotes «...»
I made a snippet like this that will wrap something in quotes suitable for HTML ("). Just add a snippet that contains this:
«$TM_SELECTED_TEXT»
And give it a key equivalent that you like (I used Ctrl-Shift-Q). If you want it to happen just by selecting a word and typing «, then it might work if you define « and » under highlightPairs. Not sure about that one.
Rob
Rob McBroom <textmate@...> writes:
On Aug 30, 2006, at 1:03 PM, guerom00 wrote:
If you want it to happen just by selecting a word and typing «, then it might work if you define « and » under SmartTypingPairs. Not sure about that one.
Rob
I tried that but it does not seem to work... Actually, while testing, I have noticed that for a plain text document, only (), {} and [] seems to work for me... So now, I'm wondering if there's not a bug here...
But I still would like very much to be able to do it via the ⌃W trick :)
On Aug 30, 2006, at 2:24 PM, guerom00 wrote:
I tried that but it does not seem to work... Actually, while testing, I have noticed that for a plain text document, only (), {} and [] seems to work for me... So now, I'm wondering if there's not a bug here...
But I still would like very much to be able to do it via the ⌃W trick :)
I got it to work (mostly). I added the following to a new "Preferences" section of my personal bundle:
{ smartTypingPairs = ( ( '«', '»' ) ); }
…and gave it a scope of "text". It doesn't work in PHP scopes unless I add "source" to the scope, and even then, it doesn't work in Mail scopes (text.mail.markdown and text.html.markdown). Maybe there is a bug?
Rob
Rob McBroom <textmate@...> writes:
I got it to work (mostly). I added the following to a new "Preferences" section of my personal bundle:
{ smartTypingPairs = ( ( '«', '»' ) ); }
…and gave it a scope of "text". It doesn't work in PHP scopes unless I add "source" to the scope, and even then, it doesn't work in Mail scopes (text.mail.markdown and text.html.markdown). Maybe there is a bug?
Rob
Indeed. Defining those in a custom bundle seems to work. Maybe the «text» scope did the trick. That's good enough for me. Thanks very much.
On 30/8/2006, at 20:37, Rob McBroom wrote:
I got it to work (mostly). I added the following to a new "Preferences" section of my personal bundle:
{ smartTypingPairs = ( ( '«', '»' ) ); }
…and gave it a scope of "text". It doesn't work in PHP scopes unless I add "source" to the scope, and even then, it doesn't work in Mail scopes (text.mail.markdown and text.html.markdown). Maybe there is a bug?
The smartTypingPairs preferences with the most specific scope selector will win, i.e. the contents of the array is not added up -- the reason for that is that then it would not be possible to exclude pairs in more specific contexts.