Hi
Often I am typing for example instanse.method_a(:param => "value"_) with _ I marked where the caret is placed.
So the question is: is there any way to move caret from the position on the example to the position right after right parentheses without moving my fingers to cursor keys.
So I want to be able then type .method_b on the same line as fast as possible.
This case is also applicable for single and double quotes.
Thx
Alex Rudyk wrote:
Hi
Often I am typing for example instanse.method_a(:param => "value"_) with _ I marked where the caret is placed.
So the question is: is there any way to move caret from the position on the example to the position right after right parentheses without moving my fingers to cursor keys.
So I want to be able then type .method_b on the same line as fast as possible.
This case is also applicable for single and double quotes.
If the right paren was added by automatic pair matching, you should just be able to type a right paren to skip over it. Otherwise, how about recording a macro to move one character to the right (using the cursor keys, of course) and assigning it to a key of your choice? Or creating a snippet that you can tab through?
You could possibly get more creative by writing a command bound to the period key, examining $TM_CURRENT_LINE and $TM_COLUMN_NUMBER to take different actions depending on whether or not the next character is a right paren.
On 16.10.2008, at 20:17, Steve King wrote:
Alex Rudyk wrote:
Hi Often I am typing for example instanse.method_a(:param => "value"_) with _ I marked where the caret is placed. So the question is: is there any way to move caret from the position on the example to the position right after right parentheses without moving my fingers to cursor keys. So I want to be able then type .method_b on the same line as fast as possible. This case is also applicable for single and double quotes.
Or record a macro:
Find: (?<=[]"')])(?=\s|$)
Regular expr: true ignore case: false Wrap around: true
- press Next
- save this macro, bind it to what ever.
This works for () [] {} "" '' and the caret could be in any position inside these pairs. This also works for something like:
(Hel|lo world)
| := caret
Cheers,
--Hans
On Thu, Oct 16, 2008 at 7:55 PM, Alex Rudyk alr@me.com wrote:
Hi
Often I am typing for example instanse.method_a(:param => "value"_) with _ I marked where the caret is placed.
So the question is: is there any way to move caret from the position on the example to the position right after right parentheses without moving my fingers to cursor keys.
So I want to be able then type .method_b on the same line as fast as possible.
Another way to do it is to just type the period to the left of the closing parenthesis and then use ctrl-t to swap the characters. Then the period will be after the closing parenthesis and your caret will be after the period...
Jonas
Emacs-style ^F also works.
On Sun, Oct 19, 2008 at 6:00 PM, Jonas Due Vesterheden < jonasduevesterheden@gmail.com> wrote:
On Thu, Oct 16, 2008 at 7:55 PM, Alex Rudyk alr@me.com wrote:
Hi
Often I am typing for example instanse.method_a(:param => "value"_) with _ I marked where the caret is placed.
So the question is: is there any way to move caret from the position on
the example
to the position right after right parentheses without moving my fingers
to cursor keys.
So I want to be able then type .method_b on the same line as fast as
possible. Another way to do it is to just type the period to the left of the closing parenthesis and then use ctrl-t to swap the characters. Then the period will be after the closing parenthesis and your caret will be after the period...
Jonas
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Oct 16, 2008, at 19:55, Alex Rudyk wrote:
Often I am typing for example instanse.method_a(:param => "value"_) with _ I marked where the caret is placed.
So the question is: is there any way to move caret from the position on the example to the position right after right parentheses without moving my fingers to cursor keys.
Put this in a new file named "~/Library/Speech/Speakable Items/ Application Speakable Items/TextMate/Escape bracket":
--8<---- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd "> <plist version="1.0"> <dict> <key>DefaultCommandName</key> <string>Escape bracket</string> <key>KeyPressArray</key> <array> <dict> <key>CommandKeyDown</key> <false/> <key>ControlKeyDown</key> <false/> <key>OptionKeyDown</key> <false/> <key>ShiftKeyDown</key> <false/> <key>VirtualKeyCode</key> <integer>124</integer> </dict> </array> </dict> </plist> --8<----
Then go to System Preferences -> Speech, and turn on Speakable Items. Then allow it to continuously listen for commands, and make sure Application Specific Items is checked in the Commands tab. You can then escape a single bracket (or even, as a hidden feature, quotation mark) simply by telling your computer to do so.