I generally like smart typing feature, but it gets in the way sometimes.
For example if I want to add parens around expression, I often just get () before it (if expression starts with ! or $). It's horror when I need to change double quotes to single quotes. I end up having something like: "'""'"
Is it possible to configure it to work only when there is whitespace/EOL ahead of cursor? Or to disable it for cases I mentioned above? I don't want to disable it completly and I don't want to add symbols to word characters list.
On 12/3/05, porneL textmate@pornel.net wrote:
I generally like smart typing feature, but it gets in the way sometimes.
For example if I want to add parens around expression, I often just get () before it (if expression starts with ! or $).
For this, you can select the expression and then just type a left paren.
It's horror when I need to change double quotes to single quotes. I end up having something like: "'""'"
Is it possible to configure it to work only when there is whitespace/EOL ahead of cursor? Or to disable it for cases I mentioned above? I don't want to disable it completly and I don't want to add symbols to word characters list.
This one bites me fairly often, and unlike the parens doesn't have an easy workaround that I'm aware of. I like the idea of having Smart Typing being more selective when it comes to quotation marks.
Other ideas or workarounds, anyone?
pb
-- Paul Bissex http://e-scribe.com/news/ Northampton MA USA 01061-0847
On Dec 4, 2005, at 9:12 AM, Paul Bissex wrote:
On 12/3/05, porneL textmate@pornel.net wrote:
I generally like smart typing feature, but it gets in the way sometimes.
For example if I want to add parens around expression, I often just get () before it (if expression starts with ! or $).
For this, you can select the expression and then just type a left paren.
It's horror when I need to change double quotes to single quotes. I end up having something like: "'""'"
Is it possible to configure it to work only when there is whitespace/EOL ahead of cursor? Or to disable it for cases I mentioned above? I don't want to disable it completly and I don't want to add symbols to word characters list.
This one bites me fairly often, and unlike the parens doesn't have an easy workaround that I'm aware of. I like the idea of having Smart Typing being more selective when it comes to quotation marks.
Other ideas or workarounds, anyone?
pb
Maybe a command called 'toggle quotes' that operates on the selected text and does something like:
#!/usr/bin/env ruby print ENV['TM_SELECTED_TEXT'].gsub(/('|")(.*)('|")/) { |z| $1 == '"' ? "'#{$2}'" : ""#{$2}"" }
Just a quick hack, I haven't checked if anything in particular breaks it.
It's horror when I need to change double quotes to single quotes. I end up having something like: "'""'"
This one bites me fairly often, and unlike the parens doesn't have an easy workaround that I'm aware of. I like the idea of having Smart Typing being more selective when it comes to quotation marks.
Other ideas or workarounds, anyone?
I had a macro that would toggle quotes, but it didn't work correctly all the time, because sometimes the macro would type the new quote and its pair, and sometimes not.
On 3/12/2005, at 20:24, porneL wrote:
Is it possible to configure it to work only when there is whitespace/EOL ahead of cursor? Or to disable it for cases I mentioned above?
Only through scoping, but that's not worth going into, I think.
The problem with only WS is e.g. nested smart-typing characters, like pressing ( then ", here ) will be to the right when you press ".
As someone else mentioned, for wrapping, selecting the stuff and pressing the open-char can eliminate the one problem you had, and the macro to toggle quotes is worth a shot, otherwise as long as you first delete the opening quote, then type the new quote, it shouldn't insert two, and typing the first before the last, will cause the last to not be doubled, because there's the opening one prior on the line, even when there's WS to the right of the caret.