Is there a way to bind the Home key in a way so that it
behaves similar to UltraEdit?
Nearly 2 years has past, since I last asked about this:
http://thread.gmane.org/gmane.editors.textmate.general/16116
Maybe there is a solution now?
The first time you press Home then the cursor jumps to
the first letter on the line (/^\s*/).
The second time you press Home it jumps to
the beginning of the line (/^/).
position A = ^
position B = ^\s*
Item1. pressing home and cursor jumps to position B.
Item2. except when cursor already is at position B, then it jumps to A.
Item3. doesn't modify the file.
Item4. when shift is held down then it preserves the selection correct.
I have tried different approaches mentioned in the past on
this list, but they have problems with Item3 and Item4.
I have also tried making my own ruby scripts for it, but
there was also problems with Item3 and Item4.
Has anyone a well behaved Smart Home command?
####################################################
# Good: Item1 and Item2
# Bad: Item3 and Item4
#
# Save: Nothing
# Input: Selected Text or Line
# Output: Insert as Snippet
# Activation: Key Equivalent, HomeKeyArrow
# Scope Selector: <blank>
####################################################
#! /usr/bin/ruby
line = ENV['TM_CURRENT_LINE']
index = ENV['TM_LINE_INDEX'].to_i
# extract leading whitespace
remain = line.sub(/(^[ \t]*)/, '')
whitespace = $1
if whitespace == nil
whitespace = ''
elsif index == whitespace.size
whitespace = ''
else
line = remain
end
# escape $ \ `
line.gsub!(/([\$\\`])/){"\\#$1"}
# place cursor
print "#{whitespace}${1}#{line}"
####################################################
--
Simon Strandgaard
my graphics program for mac - http://toolboxapp.com/
None of the Java templates seem to create properly; both from the File-
>New From Template as well as from the the project window...
I haven't gotten the time to look into why yet; but does anyone
already know about this?
-N.
Hi All,
I’m not sure if this has already been addressed, but I noticed
that my CSS language grammar highlights “transparent” in
{background-color: transparent;}, and most everything after that, as
an error (scope = invalid.illegal.css). The more common {background:
transparent;} doesn’t trigger the error, and in that
case “transparent” gets the scope “name =
'support.constant.property-value.css'.” I added transparent to
the value list in “name = 'support.constant.color.w3c-standard-
color-name.css',” which may not be the right place, but works
for me.
peace - oli
> On Fri Dec 5 19:54:25 Simon Strandgaard wrote:
>
>> Is there a way to bind the Home key in a way so that it behaves
>> similar to UltraEdit?
>
> On Fri Dec 5 22:51:55 Oliver Taylor wrote:
>>
>
> (please correct me if I'm wrong)
>
> Don't think it's possible. This is because I don't think TextMate can
> "see" the HOME and END keys being pressed. The OS must intercept the
> keypress and move the view without telling TextMate it even does it.
>
> Maybe a third-part macro utility like Keyboard Maestro could help
> here.
Wow. That was just dumb. Of course TextMate can assign HOME and END to
snippets etc.
What am I? New?
The Markdown bundle:
- Correctly highlights hyphen-delimited bullet lists, and
- Correctly translates hyphen-delimited bullet lists to HTML, but
- Does not allow the writing of such lists! Instead, hyphen-tab creates a horizontal line.
This is a problem because:
- Users may want to use hyhpens to demark bulleted lists instead of asterisks or plus signs for visual reasons
- Users may want to use hyhpens to demark bulleted lists instead of asterisks or plus signs because the hyphen is the only punctuation of those options which does not require use of the Shift button
- This behavior occurs even when converting a paragraph to a bulleted list item (result is "----------[...]---previous paragraph text")
A suggested fix is:
- Force users to type two hyphens for the horizontal-line auto-completion
Thanks,
Alan Hogan
Hi folks,
I'm a Wordpress user, and I also use a few plugins that make use of
custom fields, which are arbitrary key,value pairs that can be
associated with posts.
I've implemented support for these into the blogging bundle. I've
attached both a diff and a zip of the entire modified bundle.
It adds a 'Custom' header item, which has the format:
Custom: field_name (field_id) = field_value
Where field_id is an optional numeric value, and retrieved when
fetching posts.
Cheers,
Michael
--
Michael Tyson | michael.tyson.id.au
m: (+61) 0407 754 124
e: mike(a)tyson.id.au
aim: mikerusselltyson
twitter: MichaelTyson
Hi
Misadventures of a Wizard's Apprentice :
I found in this message : http://lists.macromates.com/textmate/2007-February/017504.html
this idea
ENV['PATH'] = %x{sh -c '. "$BASH_ENV"; echo $PATH'}
I put this line in the file require_cmd.rb and with this line, I can
compile
without setting the PATH in the Shell Variables.
I would like to know if this idea is fine or if it' dangerous ...
Alain
the code :
ENV['PATH'] = %x{sh -c '. "$BASH_ENV"; echo $PATH'}
require ENV["TM_SUPPORT_PATH"] + "/lib/escape"
require ENV["TM_SUPPORT_PATH"] + "/lib/exit_codes"
module TextMate
class << self
def require_cmd(cmd)
unless File.executable?(cmd) or ENV['PATH'].split(':').any? { |
dir| File.executable? File.join(dir, cmd) }
TextMate::HTMLOutput.show(:title => "Can't find “#{cmd}” on
PATH.", :sub_title => "") do |io|
io << "<p>The current PATH is:</p>"
io << "<blockquote>"
ENV["PATH"].split(":").each do |p|
io << htmlize(p + "\n")
end
io << "</blockquote>"
io << "<p>Please add the directory containing
“<code>#{cmd}</code>” to <code>PATH</code> in TextMate's Shell
Variables preferences.</p>"
io << "<p>Alternatively, the PATH can be retrieved from
Terminal but this requires a relaunch: "
io << "<button onclick=
\"TextMate.system('#{(ENV["TM_SUPPORT_PATH"]+"/bin/
set_tm_path.sh").gsub(" ", "\\\\\\\\ ")}', null)\">Set PATH and
Relaunch.</button></p>"
end
TextMate.exit_show_html
end
end
end
end
I would like to see if there is a way to conditionally include some other
files (or part of them) directly from textmate.
For example I have a file which contains a program contained in another
file, so it would be nice to autoupdate that part of the text file every
time.
Does it makes any sense??
Something like
\inc{otherfile}[0-10]
At every opening of the file fetches the first 10 lines of otherfile. The
problem is how to distinguish text from include instruction.
I may have an idea but maybe it doesn't make sense the whole thing...
--
View this message in context: http://www.nabble.com/conditional-inclusion-tp20853565p20853565.html
Sent from the textmate users mailing list archive at Nabble.com.
I see that OCaml bundle knows which function we're in, as it's shown
in the lower right. Yet the fold handles are all screwed up and don't
do no foldin', and selecting [Scope] in the bundle editor always
selects the whole document. But we know we are in a function! How
can we make it a scope?
Cheers,
Alexy
Hi,
I have a bash alias called mb ("mate bash") to edit my bash config files
(and a few others). It's pretty simple:
alias mb='mate ~/.alias ~/.bashrc ~/.profile ~/.inputrc ~/.screenrc'
This worked fine when I first used it (quite a long time ago) but I've just
tried it today and it only half works. I get the project drawer listing the
5 files, but .profile and .bashrc don't open in TextMate when I single-click
them. If I double-click them, .profile opens in TextEdit and .bashrc gets
executed in a terminal.
What settings can I change to get back the old behaviour? I realise it's
probably a system setting rather than something TextMate-specific, but I
can't even find a way to show dotfiles in the finder so I can "always open
with...".
Thanks
Jon