Hi all,
Been lurking for a bit and have finally come upon a situation where i need some of TM's more advanced features, if anyone can offer some pointers on the following - it would be greatly appreciated.
I need to:
surround a selection with some additional text ie 1,2 becomes [1,2] after selecting the 1,2
on the line with the carat, trim any excess spaces from the end of the line
Any pointers appreciated, Nik
On 17/01/2006, at 8:10, Nik Derewianka wrote:
I need to: surround a selection with some additional text ie 1,2 becomes [1,2] after selecting the 1,2
Make a command, in: selected text, out: replace selection. Then just make the command: echo "[$TM_SELECTED_TEXT]"
on the line with the carat, trim any excess spaces from the end of the line
For this one it's harder since commands don't let you do stuff like replace the current line, etc. (which I've needed a few times). You can make a command which strips the selection, and then a macro which select the current line and then fires the command.
As for how to make the command, I don't know of (but there might exist) a shell-tool for stripping. You could #!/usr/bin/ruby puts gets.strip
...although it's a bit overkill :-p.
-- Sune.
On 17/1/2006, at 12:59, Sune Foldager wrote:
on the line with the carat, trim any excess spaces from the end of the line
For this one it's harder since commands don't let you do stuff like replace the current line [...]
Setting fallback input to line and output to replace selection will replace the line, when there is no selection.