[TxMt] Re: escaping characters (in the document)

Kevin Ballard kevin at sb.org
Wed Nov 29 23:39:34 UTC 2006


Why do you want to type control codes directly? It's a lot safer to  
use escape sequences.

Bash even has a string quote form $'string', which supports escapes,  
and an escape \cx which stands for the control-x character. This  
means you can represent the ^[ character as $'\c['.

On Nov 29, 2006, at 4:17 PM, Jacob Rus wrote:

> Rob McBroom wrote:
>> For shell init scripts and various other purposes, I'd like to be  
>> able to "type" characters like ⌃[ or ⌃G. You know, the kind of  
>> thing you would precede with ⌃V in the Terminal. It seems that  
>> Cocoa has a key binding for this (NSQuotedKeystrokeBinding, which  
>> is ⌃Q by default), but it is used for another purpose in  
>> Textmate. Has the functionality been remapped or do I need to try  
>> to define it for Textmate myself? It doesn't seem to be set…
>
> I'm pretty sure TextMate's text control doesn't support that, but  
> you can try.
>
>>     rob at kendra ~> defaults read com.macromates.Textmate  
>> NSQuotedKeystrokeBinding
>>     2006-11-29 14:47:10.910 defaults[6713]
>>     The domain/default pair of (com.macromates.Textmate,  
>> NSQuotedKeystrokeBinding) does not exist
>> On a related note, I'd like to be able to "see" these characters  
>> as well, or perhaps toggle them of and on (with ⌥⌘I ideally).  
>> Texmate is better than most Cocoa apps, as it seems to display a  
>> space in place of such characters instead of nothing at all, but  
>> I'd like to know what that space represents. Has anyone tried  
>> enabling [NSTextShowsControlCharacters][] in Textmate? I'm  
>> guessing there would be undesired side-effects.
>
> Did you try showing invisibles?  I believe these show up as  
> different from spaces or tabs, but I don't remember exactly what  
> they look like.
>
> In any case, you should be able to copy/paste them into a textmate  
> control from another window, or make a command to insert them,  
> something that takes the previous letter ("[" for instance), and  
> turns it into the control sequence ("⌃[").

-- 
Kevin Ballard
http://kevin.sb.org
kevin at sb.org
http://www.tildesoft.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20061129/b39abf1c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2432 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20061129/b39abf1c/attachment.p7s>


More information about the textmate mailing list