I often find myself wanting to place the cursor just left of the first non-whitespace character in a line. I know ctrl-A will get me to the very beginning of the line. Is there another command that will get me just left of the first non-whitespace character? thanks, -Morgan
On Aug 2, 2010, at 2:44 PM, Morgan Packard wrote:
Is there another command that will get me just left of the first non-whitespace character?
Not that I know of, but I find myself doing this: Command-Left, Option-Right. That sequence does what you're asking for. You can therefore create a macro of those two keystrokes and map it to the key command of your choosing.
+dru
On 08-02-2010 4:53 PM, Dru Kepple wrote:
Not that I know of, but I find myself doing this: Command-Left, Option-Right. That sequence does what you're asking for. You can therefore create a macro of those two keystrokes and map it to the key command of your choosing.
That's a handy trick, but it doesn't quite work for me. When I use Option-Right, if there's a tab at the beginning of a line (a common occurrence in CSS and HTML), it skips to the end of the first word instead of the beginning. So if the line is:
<tab>color:
The caret moves to between the "r" and the colon...is there a way to avoid this?
Keith
On Aug 2, 2010, at 3:02 PM, Keith Solomon wrote:
On 08-02-2010 4:53 PM, Dru Kepple wrote: Not that I know of, but I find myself doing this: Command-Left, Option-Right.
That's a handy trick, but it doesn't quite work for me. When I use Option-Right, if there's a tab at the beginning of a line (a common occurrence in CSS and HTML), it skips to the end of the first word instead of the beginning. So if the line is:
<tab>color:
The caret moves to between the "r" and the colon...is there a way to avoid this?
Well, that's interesting...I've never noticed that. Try the same example as you mention only with two tabs at the beginning. And that does what I said it would do. I guess I work a lot in code files where the indentation is typically at least two-deep.
I'm thinking maybe it's possible to write a Command that matches beginning-of-line + optional whitespace, and uses the TextMate URL scheme to place the cursor at the appropriate column position. Maybe not. I'm sorry, I don't have a lot of time right now to investigate.
+dru
Maybe a quick solution is to create tmcommand, input: none, output:discard
with the command:
open "txmt://open/url?line=$TM_LINE_NUMBER&column=$( perl -e ' $a = $ENV{"TM_CURRENT_LINE"}; $a =~ s/^\s*//; $diff = length($ENV{"TM_CURRENT_LINE"}) - length($a); print ++$diff; ')"
Cheers, --Hans
Or record a macro à la
-go to begin of line -search for \S -deselect by pressing arrow left
macro: ⌘⇠ ⌘F (search for: \S regexp ticked; all others unticked) ←
this should work for all lines whose length is greater than 1 and it should be much faster
Cheers,
--Hans
well, perhaps I could use this as an opportunity to ask once again if any of you Grep gurus out there could write a script that selects paragraphs and lines *only from the first to last character*?
i.e. this:
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean odio nibh, euismod a, lobortis in, laoreet eu, eros. Praesent lorem risus, commodo sit amet, viverra in, sagittis nec, justo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean odio nibh, euismod a, lobortis in, laoreet eu, eros. Praesent lorem risus, commodo sit amet, viverra in, sagittis nec, justo.<p>
not this:
<p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean odio nibh, euismod a, lobortis in, laoreet eu, eros. Praesent lorem risus, commodo sit amet, viverra in, sagittis nec, justo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean odio nibh, euismod a, lobortis in, laoreet eu, eros. Praesent lorem risus, commodo sit amet, viverra in, sagittis nec, justo. <p>
it would greatly speed up my workflow.
cheers, b
On Aug 2, 2010, at 3:36 PM, Hans-Jörg Bibiko wrote:
Or record a macro à la
-go to begin of line -search for \S -deselect by pressing arrow left
macro: ⌘⇠ ⌘F (search for: \S regexp ticked; all others unticked) ←
this should work for all lines whose length is greater than 1 and it should be much faster
Cheers,
--Hans
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Aug 2, 2010, at 8:21 PM, plastichairdoo wrote:
well, perhaps I could use this as an opportunity to ask once again if any of you Grep gurus out there could write a script that selects paragraphs and lines *only from the first to last character*?
I gave a couple of suggestions last time you asked. Among them was ⌃⇧⌘W. It seems to do exactly what you want. Did you ever try it?
What about the Markdown bundle? That’s probably even easier as it will take care of the entire document at once. Did you try that?
thanks rob - you know I misread your key command last time so I didn't think that it worked. now that I realize that it does I am happy and satisfied. sorry about that. as far as the Markdown bundle - I've never really used Markdown, it seems like a good technology but I'd have to spend a little time getting used to it before I could start using it effectively. I'll start looking into it. cheers, bennett
On Aug 3, 2010, at 5:07 AM, Rob McBroom wrote:
On Aug 2, 2010, at 8:21 PM, plastichairdoo wrote:
well, perhaps I could use this as an opportunity to ask once again if any of you Grep gurus out there could write a script that selects paragraphs and lines *only from the first to last character*?
I gave a couple of suggestions last time you asked. Among them was ⌃⇧⌘W. It seems to do exactly what you want. Did you ever try it?
What about the Markdown bundle? That’s probably even easier as it will take care of the entire document at once. Did you try that?
-- Rob McBroom http://www.skurfer.com/
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
one more thing - if I wanted to alter this command slightly so that I could use it without the "< >" brackets - lets say if I wanted to surround a block with "{ }" or what have you, how would I go about doing that - I tried messing with the code but my perl is absolutely non-existant and all I ended up with was a big mess :p anyway - thanks, bennett
On Aug 3, 2010, at 5:07 AM, Rob McBroom wrote:
On Aug 2, 2010, at 8:21 PM, plastichairdoo wrote:
well, perhaps I could use this as an opportunity to ask once again if any of you Grep gurus out there could write a script that selects paragraphs and lines *only from the first to last character*?
I gave a couple of suggestions last time you asked. Among them was ⌃⇧⌘W. It seems to do exactly what you want. Did you ever try it?
What about the Markdown bundle? That’s probably even easier as it will take care of the entire document at once. Did you try that?
-- Rob McBroom http://www.skurfer.com/
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
hello all - I was playing around with the auto-complete features in HTML (which I don't really use since I prefer snippets) and I found a whole bunch of strange tags that I don't recognize. I tried googling them but came up empty for things like "d ondblclick" and "el class" - not to mention the stranger fact that if I selected one I came up with repeating first letters - i.e. starting with <d> with insertion point inside the brackets after the 'd' gives me '<d d ondblclick="">'
so forgive my ignorance, but what exactly is this?
thanks, bennett
"the quest for knowledge is endless" -Ancient Chinese Secret