Hi.
wondering if I'm missing something, or else how I'd go about this.
in vim / emacs one can specify a 'repeat count' for input, so i could easily insert 80 '-'s by typing (in vim) 80i-<esc>
which is far less boring than holding the key down, and maps well to instances where a more complex repeated sequence is needed.
can we do something like this in TM, as a built-in ? I mean in the general sense, though if there are commands to 'underline words' etc I'm still interested in those.
cheers, David
FWIW, to underline a word, use the following as a command with Input : selected text || line, output: replace.
"${TM_RUBY:=ruby}" -e ' txt = ENV["TM_SELECTED_TEXT"].gsub(/\n/,"") puts txt + "\n" + ("-" * txt.length) '
cheers, David
On 27/11/2005, at 8:38 PM, David Lee wrote:
Hi.
wondering if I'm missing something, or else how I'd go about this.
in vim / emacs one can specify a 'repeat count' for input, so i could easily insert 80 '-'s by typing (in vim) 80i-<esc>
which is far less boring than holding the key down, and maps well to instances where a more complex repeated sequence is needed.
can we do something like this in TM, as a built-in ? I mean in the general sense, though if there are commands to 'underline words' etc I'm still interested in those.
cheers, David
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
On 27/11/2005, at 12:10, David Lee wrote:
FWIW, to underline a word, use the following as a command with Input : selected text || line, output: replace. [...]
There are actually two neat commands in the Markdown bundle to underline lines with - or =, on the line below, start with either of these, and press tab (setup only for the Markdown scope).
There's no general way to do vim-style repeat of next action.
thanks Allan, they are neat. Now i know about $TM_LINE_NUMBER and $TM_COLUMN_NUMBER ;) i've borrowed one of them.
Note: i had to change line line 4 in the following (markdown Heading lvl2):
if [[ $TM_COLUMN_NUMBER == 1 ]] then head -n $(($TM_LINE_NUMBER -1))|tail -n 1|sed 's/./-/g'|tail -c +"$TM_COLUMN_NUMBER" else printf '-\t' # <= this line here fi
to
else printf '-'; printf '\t'
otherwise it inserted the - literally when there are > 1 -'s on the line.
YMMV but maybe the snippet should be updated ( and there's likely a slightly more handsome way to do it)
cheers, David
On 28/11/2005, at 12:25 AM, Allan Odgaard wrote:
On 27/11/2005, at 12:10, David Lee wrote:
FWIW, to underline a word, use the following as a command with Input : selected text || line, output: replace. [...]
There are actually two neat commands in the Markdown bundle to underline lines with - or =, on the line below, start with either of these, and press tab (setup only for the Markdown scope).
There's no general way to do vim-style repeat of next action.
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
On 27/11/2005, at 14:45, David Lee wrote:
[...] otherwise it inserted the - literally when there are > 1 -'s on the line.
YMMV but maybe the snippet should be updated ( and there's likely a slightly more handsome way to do it)
Indeed it should. I've updated it to:
printf -- '-\t'
The “--” part disables argument parsing for the rest of the line.