Hi,
I need sometimes to create multiple folders from a
list of names in a file
for example in a file : list_names.txt
January
February
...
December
I would like from textmate use a command like : select the names
and get the folders.
With bash and without spaces in the names, it's possible to get a result
with the file list_names.txt (I'm a newbie with bash ! )
#! /bin/bash
for item in `cat list_names.txt`
do
mkdir $item
done
But this is not very fine because I can't give the path for output
folders
1) Is it possible with textmate to create a command and to give the
path
with an interactive action
2) Do you know a Ruby script to make this ? (it's to learn about Ruby)
3) Perhaps "Interactive Input" is an answer to give the path for the
ouput place
but I run textmate with Snow Leopard and tm_interactive_input.dylib
gives me some problem with laTeX.
4) Perhaps with regex, it is possible to determine names with spaces
inside
if RC is the separator ?
Then, in these folders,I need to create a lot of files like
In tkz_graph folder
tkz_graph_example_1.tex
tkz_graph_example_2.tex
...
tkz_graph_example_20.tex
idem with tkz_2d etc ...
To create these files, I use the same LaTeX template and the question
is the
like the first one.
How to create a command with the number of files and
and the possibility to choice a directory?
An idea was to select "20" and "/Users/ego/work" and to launch the
command but
I'm not an expert with bash or Ruby to make this ...
Best regards
Alain Matthes
Hi - I remember there was an enhanced version of Command-T
, which is a bundle if I remember correctly. But I forgot
the name of the bundle.
Can anybody point me to the bundle?
Takaaki
This has been covered before ( http://lists.macromates.com/textmate-dev/2009-May/013933.html ), so I'm not hopfeul, but I thought it was worth asking again, in case anything has changed. Probably not.
The responders to the thread linked above recommend writing Ruby modules and stuff, which I do when I'm working on a bundle, but what if I have a bundle and I want to call another bundle's commands?
Fortunately, I'm in control of both bundles, but for organizational and responsibility reasons, I don't want to combine them. One is very utilitarian (basic FTP) and the other is extremely specific (stuff related to a single project I work on, has absolutely no relevance to anything outside of the project). The good news is that I already have my bundles set up to be somewhat modular/class-driven.
I realize that doing this creates dependencies between bundles, but I'm OK with this, and feel it's better than recreating my FTP commands in another bundle.
One thought I had would be to get the TM_BUNDLE_SUPPORT value, pop off the bundle name and replace it with the bundle name of the target, and get to the Ruby file I need. But then...wouldn't any TM_BUNDLE_SUPPORT values used in the other bundle's scripts evalulate to the wrong place?
Would it be better to find a place for such universally appealing ruby files outside of TextMate? Should I learn how to write plugins, and/or deposit code into the SUPPORT_PATH?
The original poster's idea seems close to my idea. But it would be sweet to be able to do something like:
require ENV['TM_SUPPORT_PATH'] + '/lib/bundle_access'
BundleAccess.executeCommand("Some Bundle", "Some Command", argin)
Or something that could safely instantiate Ruby objects from other bundles to allow them to be used in your bundle without mucking with the BUNDLE_SUPPORT value.
I don't know...just spitballing.
Thanks,
Dru
Hi there,
I'm using build 1509 (Cutting Edge).
I'm experimenting with PHP alternate syntax (no curly braces) and
can't get the blocks to fold.
My PHP language bundle contains the following:
foldingStartMarker = '(/\*|\{\s*$|<<<HTML)';
foldingStopMarker = '(\*/|^\s*\}|^HTML;)';
Can anybody point me in the right direction to get my alternate syntax
to play nice ?
PHP alt syntax looks like this:
if ($high < 11):
return $high;
else : return false;
endif;
-Peter
Anyone want to take a shot at this one...
Write "foodbar" in textmate, select it, and inspire lookup word in
google and link, it will be replaced with 'Received exception:
undefined method '.
A lot of the time it also crashes TM. I am on 10.5, but this has been
happening for a long time. I just learned of this feature, and it is
very handy.
#!/usr/bin/env ruby -wKU
# an evolution of the code from skiadas.dcostanet.net/afterthought
# retrieves link from Google automatically and creates XHTML link
# improved call to progress bar, added ability to retrieve title
# of page and create title attribute in link using idea
# borrowed from iamrice.org. Improved regex to handle title tags
# newlines, spaces and capitalization differences
require ENV['TM_SUPPORT_PATH'] + '/lib/progress.rb'
require ENV['TM_SUPPORT_PATH'] + '/lib/escape.rb'
require 'net/http'
require 'open-uri'
require 'erb'
def getLinkWithTitle(phrase)
TextMate.call_with_progress(:title => "Contacting Google", :message
=> "Retrieving Link for “#{phrase}”…") do
response = Net::HTTP.get_response(URI.parse(URI.escape("http://www.google.com/search?q=#
{phrase}&btnI=I'm+Feeling+Lucky")))
url = response.to_hash['location'].to_a.first
fp = open(url)
title = fp.read.match(/<title>([^<>]*)<\/title>/i).to_a[1]
title = title.strip
return url, title, phrase
end
end
url, title, input = getLinkWithTitle(STDIN.read)
print ERB.new(ENV['TM_LINK_FORMAT']).result
--
Scott * If you contact me off list replace talklists@ with scott@ *
LaTeX users:
My plan is to remove most of the completion commands and latex
snippets from the LaTeX bundle. They will be replaced by a single
command. I have a prototype under construction, you can see how it
works here:
http://lasersox.net/LaTeXCompletion.m4v
Basically there is a tree of completions, and you can navigate them
just by typing. We can work citation completion, and all existing
snippets into this system.
Thoughts?
Hi,
The big problem for me is the completion with ⌥⎋, I often wrote
this remark on the list but without success ...
Perhaps Brad has not enough time to look at this ...
I would like to know if I'm the only one to have the next problem
a) Create a .tex file: essai.tex
you can put for example this inside :
Is it a bug?\label{title}
yes\label{answer}
b) Create a .tex file: try_completion.tex
\documentclass[11pt]{article}
\begin{document}
\input{essai.tex}
yes\re
\end{document}
now after \re ⌥⎋, no result
c) Remove the line \input{essai.tex}
then after ⌘S, \re ⌥⎋ gives
a window with
real
ref
etc...
d) but when the caret is inside the braces of \ref{ } , the
completion is always correct
My solution : I modified the LateXCommandCompletions.rb file.
def recursiveFileSearch(initialList)
extraPathList = []
fileExt = "tex"
# I add the last line
Perhaps somebody can tell me if this solution is correct and if the
problem exists out of my home !!
Best Regards
Alain Matthes
PS I try the completion with ⌘\ but with a french keyboard we need 4
fingers and 3 fingers for
⌘}
I prefer §, ⌘§ and ⌥§ for the macro LaTeX Symbol of Guido
Governatori, This macro is fine
because it's more natural (for example with the arrows) and the macro
adds $ ... $ .
Perhaps a macro Insert Math LaTeX Symbol in the main bundle will be a
good thing
Hi
I made a clean install of Snow Leopard, and the first soft installed,
was TextMate
I go to the LaTeX prefs of the official bundle LaTeX and when I go
out ot the prefs,
I got this message :
.... configure.py:8 DeprecationWarning os.popen4 deprecated
What is it ?
Best regards
Alain Matthes
I'm not sure how this happened, but ctrl-> (ctrl, shift and .) does not
create <% %> tags. I can select the menu item and get them, but the
hotkey doesn't work. I also went into the bundle editor, and reassigned
the hotkeys to something else and get nothing.
When I change it to apple <, I get a beep.
I downloaded the most recent bundles for ruby and ruby on rails. What
am I missing?