I've used TextMate off and on for a while. But, something is driving me nuts, and it's so painful that I must not be doing something correctly. I need help.
If I type
blah['
then TM will obligingly add
']
So my cursor (|) ends up like this
blah['|']
I guess it's trying to help me. So, I type 'name' and my cursor is now like this
blah['name|']
So, now what do I do???
I want keep typing. I want to get outside the ']', not inside it. But, I can't figure out how. Right now, I just hit right arrow twice. But, this is such a pain, it can't be right. What am I missing?
-Paul
On 13. Apr 2007, at 18:31, Paul Welty wrote:
[...] I guess it's trying to help me. So, I type 'name' and my cursor is now like this
blah['name|']
So, now what do I do???
See “Two useful shortcuts” here: http://macromates.com/textmate/ manual/working_with_text#auto-paired_characters_quotes_etc
Or you can disable auto-paired characters (in Preferences → Editing), if it bothers you.
blah['name|'] So, now what do I do???
I think a nice new feature here would be to allow the null-action of "tab" to be to jump over any auto-created paired-chars. Then we could just tab out of the nest and carry on. It must be very seldom that users want a real tab character inside paired-characters.
I use command+[right arrow]. They're close enough together on my macbook that I barely notice it. Granted, its the exact same number of keystrokes as pressing right-arrow twice.
j
On 4/13/07, Timothy Bates timothy.c.bates@gmail.com wrote:
blah['name|'] So, now what do I do???
I think a nice new feature here would be to allow the null-action of "tab" to be to jump over any auto-created paired-chars. Then we could just tab out of the nest and carry on. It must be very seldom that users want a real tab character inside paired-characters.
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
blah['name|'] So, now what do I do???
I think a nice new feature here would be to allow the null-action of "tab" to be to jump over any auto-created paired-chars. Then we could just tab out of the nest and carry on. It must be very seldom that users want a real tab character inside paired-characters.
Unfortunately the harddrive on my powerbook has died, so I can not try it out, but would it not be relatively simple to write such a command? just set the scope to punctuations and then do a quick check to seen if the charachter to the right of the caret is a paired-characther and if so move the caret to the right of it, of course this would make it impossible to trigger other snippet. I will try it out when I get my computer back, unless someone beats me to it.
Joachim Mårtensson
On 13 Apr 2007, at 18:41, Allan Odgaard wrote:
On 13. Apr 2007, at 18:31, Paul Welty wrote:
[...] I guess it's trying to help me. So, I type 'name' and my cursor is now like this
blah['name|']
So, now what do I do???
See “Two useful shortcuts” here: http://macromates.com/textmate/ manual/working_with_text#auto-paired_characters_quotes_etc
I addition to those two extremely useful shortcuts:
Most of the time the line is ending after the "]", so using 'cmd + right arrow' or 'ctrl + e' works fine. You can also use 'option + right arrow' to go to the start of the next word.
-- FredB
Thanks for these suggestions. At least I now know I'm not missing too much. I, too, would very much like to use the TAB to get to the outside of auto-paired insertions. But, I will try Cmd-right-arrow or cmd-return for now.
-Paul
On Apr 13, 2007, at 1:30 PM, Timothy Bates wrote:
blah['name|'] So, now what do I do???
I think a nice new feature here would be to allow the null-action of "tab" to be to jump over any auto-created paired-chars. Then we could just tab out of the nest and carry on. It must be very seldom that users want a real tab character inside paired-characters.
On Apr 13, 2007, at 1:33 PM, jeff newman wrote:
I use command+[right arrow]. They're close enough together on my macbook that I barely notice it. Granted, its the exact same number of keystrokes as pressing right-arrow twice.
On Apr 13, 2007, at 1:48 PM, Fred B wrote:
On 13 Apr 2007, at 18:41, Allan Odgaard wrote:
On 13. Apr 2007, at 18:31, Paul Welty wrote:
[...] I guess it's trying to help me. So, I type 'name' and my cursor is now like this
blah['name|']
So, now what do I do???
See “Two useful shortcuts” here: http://macromates.com/textmate/ manual/working_with_text#auto-paired_characters_quotes_etc
I addition to those two extremely useful shortcuts:
Most of the time the line is ending after the "]", so using 'cmd + right arrow' or 'ctrl + e' works fine. You can also use 'option + right arrow' to go to the start of the next word.
On 13 Apr 2007, at 20:46, Paul Welty wrote:
Thanks for these suggestions. At least I now know I'm not missing too much. I, too, would very much like to use the TAB to get to the outside of auto-paired insertions. But, I will try Cmd-right-arrow or cmd-return for now.
-Paul
But what if you want a real TAB?
-- FredB
On Apr 13, 2007, at 3:05 PM, Fred B wrote:
On 13 Apr 2007, at 20:46, Paul Welty wrote:
Thanks for these suggestions. At least I now know I'm not missing too much. I, too, would very much like to use the TAB to get to the outside of auto-paired insertions. But, I will try Cmd-right- arrow or cmd-return for now.
-Paul
But what if you want a real TAB?
I must say that I am unlikely to use a real tab in such a situation. And given that very often when having to get out of things like that I can use tab because they were created by a command/snippet, I end up trying tab always anyway, and then have to delete it, resulting in many extra keystrokes.
You can always create a command, bound to some +tab combo, that just inserts an actual tab, and use that in the rare occasions when you do need a tab.
-- FredB
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 13. Apr 2007, at 21:11, Charilaos Skiadas wrote:
But what if you want a real TAB?
I must say that I am unlikely to use a real tab in such a situation.
You never use a tab after a start bracket? Most of my code is wrapped in brackets, and despite the auto-indenter, I do occasionally need to put tabs in there myself :)
That said, TM definitely need some “bracket navigation keys” of sorts (and jump to last location etc.) -- and with dynamic scopes it _might_ just be possible to re-assign tab to “jump out of current scope” only when inside (active) smart-typing pairs (but it is an area I still need to explore).
like to use the TAB to get to the outside of auto-paired insertions.
But what if you want a real TAB?
There are of course trade offs. Given that pairs are already switchable off, they could have a tri-state preference: 0: pairs on (trapped) 1: pairs on (tab to exit) 2: pairs off
Also, for the 1 time in 20 that people want to put a real tab into a bracketed context, either a work around (fwd-delete to cancel the auto-created closure before tabbing), or else Allan might make option-tab gives a tab when tab would exit a paired-char.
on tab(pairsPrefState){ if (completion found){ do completion; }elseif (auto-pair is found && pairsPrefState == 1){ jump over auto-pairing; }else{ insert tab; } end tab
Tim
On Apr 13, 2007, at 9:31 AM, Paul Welty wrote:
Right now, I just hit right arrow twice. But, this is such a pain, it can't be right. What am I missing?
You can also just type ' and then ]. You'd have to type those characters anyway, so it can't be more of a pain than other editors.
Trevor
Paul Welty wrote:
So my cursor (|) ends up like this
blah['|']
I guess it's trying to help me. So, I type 'name' and my cursor is now like this
blah['name|']
So, now what do I do???
I want keep typing. I want to get outside the ']', not inside it. But, I can't figure out how. Right now, I just hit right arrow twice. But, this is such a pain, it can't be right. What am I missing?
What is wrong with just typing the closing characters, again?
The point of smart typing pairs is more to keep your parentheses (or whatever) properly nested, than it is to save keystrokes.
On Apr 13, 2007, at 8:23 PM, Jacob Rus wrote:
Paul Welty wrote:
So my cursor (|) ends up like this blah['|'] I guess it's trying to help me. So, I type 'name' and my cursor is now like this blah['name|'] So, now what do I do??? I want keep typing. I want to get outside the ']', not inside it. But, I can't figure out how. Right now, I just hit right arrow twice. But, this is such a pain, it can't be right. What am I missing?
What is wrong with just typing the closing characters, again?
Sometimes the closing characters have stopped being "smart", i.e. often I just want to get out of "whatever I am in". It's just useful to have a way to get out of the closest set of "closing things". Of course I am thinking of LaTeX, where the closing thing is always a "}". Perhaps it's not easy to decide in general.
The point of smart typing pairs is more to keep your parentheses (or whatever) properly nested, than it is to save keystrokes.
Haris Skiadas Department of Mathematics and Computer Science Hanover College