TextMate Command – Duplicate current selected file

How to configure in TextMate Bundle Editor:

How to configure TextMate Duplicate plugin

Here the code:

#!/usr/bin/env ruby -w

require „ftools“
require „#{ENV[‚TM_SUPPORT_PATH‘]}/lib/textmate“

selected_file = ENV[‚TM_SELECTED_FILE‘]

splitted_filename = selected_file.split(„.“)
extension = splitted_filename[splitted_filename.length-1];

new_filename = selected_file.dup
pos = selected_file.length-(extension.length+1)

new_filename.insert(pos, „_copied“)

File.copy(selected_file, new_filename)

if(File.file?(new_filename))
puts „Successfully copied the file: ‚${selected_file}'“
else
puts „FAIL!“
end

TextMate.rescan_project

Advertisements

Parallels Tools in Ubuntu 8.04 installieren

Um die Parallels Tools unter Ubuntu 8.04 installieren zu können, muss man folgenden neueren Build von Parallels downloaden: http://download.parallels.com/stuff/Parallels-Desktop-5624-Mac-en.dmg

Danach kann man mittels „Action“ -> „Install Parallels Tools“ die virtuelle CD mounten und mittels:

cd /media/cdrom
sudo ./parallels-tools.run

Reboot -> Hooray \o/!