[TxMt] CTRL-k behaviour

Allan Odgaard allan at macromates.com
Sat Nov 6 07:03:05 UTC 2004


On 6. Nov 2004, at 2:20, Curtis Schofield wrote:

> I'm trying to get used to the automatic () {} behaviour.. sometimes i 
> wrap
> if/parameterlists around existing code and i get  an automatic } or ) 
> when i don't expect.

What I generally do is type the:

    if(...)
    {
    }

above the code I want to encapsulate (utilizing the smart-typing) and 
afterwards I select the code that needs to be “wrapped” and press 
ctrl-cmd-up to move it (i.e. the selection) up one line, which puts it 
inside the brackets (generally I also then do a single alt-tab to 
indent it one extra level).

If you do it a lot, it may be possible to do a snippet that wraps the 
selection, but I spent 5-10 minutes trying to find an easy solution to 
adjust the indent, but that's currently not possible to do as a cool 
one-liner... ;)




More information about the textmate mailing list