I often find that I paste something into a document, then immediately select it to do something to it, like wrapping it in tags or converting characters to entities. Long ago I used an editor (possibly alpha) that had a 'select pasted text' command, that did the selection straight after a paste, without having to drag over it or whatever. I can't find an equivalent command in TextMate, nor any environment variables pointing to the start and end of the latest pasting that would let me implement it myself.
Have I missed something? Either a command in some bundle I don't know about or some other way of achieving the same effect?
If not, here's a feature request. Any one of the following:
Select Pasted Text command Paste and Select command (extra modifier key on cmd-V) Select after Pasting preference.
Thanks for any help or pointers.
On Feb 24, 2007, at 10:48 AM, Nigel Chapman wrote:
I often find that I paste something into a document, then immediately select it to do something to it, like wrapping it in tags or converting characters to entities. Long ago I used an editor (possibly alpha) that had a 'select pasted text' command, that did the selection straight after a paste, without having to drag over it or whatever. I can't find an equivalent command in TextMate, nor any environment variables pointing to the start and end of the latest pasting that would let me implement it myself.
Have I missed something? Either a command in some bundle I don't know about or some other way of achieving the same effect?
No you haven't missed anything. Once the text is pasted, that's it, it's now part of the document. I suppose what I would do is probably open a new file and paste the thing there, then Select All and do what I want with it. Since I don't have the need for that too often, I guess the extra couple of keystrokes are not a big problem. I suppose if you find that you repeat the exact same command to the pasted text, then it might be worth it writing a command to do what you want and take into account the text in the pasteboard.
Of course for the "wrapping in tags" thing, I would first create the tags and then paste the text inside them ;). I convert characters to entities so rarely that I don't even know the shortcut for it ;)
If not, here's a feature request. Any one of the following:
Select Pasted Text command Paste and Select command (extra modifier key on cmd-V) Select after Pasting preference.
Thanks for any help or pointers.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On Feb 24, 2007, at 9:48 AM, Nigel Chapman wrote:
I often find that I paste something into a document, then immediately select it to do something to it, like wrapping it in tags or converting characters to entities. Long ago I used an editor (possibly alpha) that had a 'select pasted text' command, that did the selection straight after a paste, without having to drag over it or whatever. I can't find an equivalent command in TextMate, nor any environment variables pointing to the start and end of the latest pasting that would let me implement it myself.
Have I missed something? Either a command in some bundle I don't know about or some other way of achieving the same effect?
If not, here's a feature request. Any one of the following:
Select Pasted Text command Paste and Select command (extra modifier key on cmd-V) Select after Pasting preference.
Thanks for any help or pointers.
Easy:
On Feb 24, 2007, at 11:40 AM, Gerd Knops wrote:
On Feb 24, 2007, at 9:48 AM, Nigel Chapman wrote:
I often find that I paste something into a document, then immediately select it to do something to it, like wrapping it in tags or converting characters to entities. Long ago I used an editor (possibly alpha) that had a 'select pasted text' command, that did the selection straight after a paste, without having to drag over it or whatever. I can't find an equivalent command in TextMate, nor any environment variables pointing to the start and end of the latest pasting that would let me implement it myself.
Have I missed something? Either a command in some bundle I don't know about or some other way of achieving the same effect?
If not, here's a feature request. Any one of the following:
Select Pasted Text command Paste and Select command (extra modifier key on cmd-V) Select after Pasting preference.
Thanks for any help or pointers.
Easy:
<Paste & Select.tmCommand>
That one breaks if you paste anything with certain reserved characters.
If you have the r 6636 version of the TextMate escape library… You can use this one instead. http://pastie.textmate.org/42665
#!/usr/bin/env ruby require ENV['TM_SUPPORT_PATH'] + "/lib/escape.rb" print "${0:#{e_snp(`pbpaste`)}}"
If you don't have the latest version of the escape library, you'll have to add http://pastie.textmate.org/42666
# escape text for use in a TextMate snippet placeholder def e_snp(str) str.to_s.gsub(/(?=[$`\}])/, '\') end
thomas Aylott — subtleGradient — CrazyEgg — sixteenColors
On 24. Feb 2007, at 18:28, Thomas Aylott (subtleGradient) wrote:
#!/usr/bin/env ruby require ENV['TM_SUPPORT_PATH'] + "/lib/escape.rb" print "${0:#{e_snp(`pbpaste`)}}"
If you need to paste more than plain ASCII, you unfortunately need to invoke pbpaste as shown below:
#!/usr/bin/env ruby require ENV['TM_SUPPORT_PATH'] + "/lib/escape.rb" print "${0:#{e_snp(`__CF_USER_TEXT_ENCODING=$UID: 0x8000100:0x8000100 pbpaste`)}}"