Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Commands/Save to CSS.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<string>saveActiveFile</string>
<key>command</key>
<string>#!/usr/bin/env ruby
file = STDIN.read[/lessc: ([^*]+\.less)/, 1] || ENV["TM_FILEPATH"]
system("lessc --verbose \"#{file}\"")</string>
file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"]))
system("lessc --verbose \"#{file}.less\" \"#{file}.css\"")</string>
<key>input</key>
<string>document</string>
<key>keyEquivalent</key>
Expand Down
22 changes: 22 additions & 0 deletions Commands/Save to minified CSS.tmCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>saveActiveFile</string>
<key>command</key>
<string>#!/usr/bin/env ruby
file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"]))
system("lessc -x --verbose \"#{file}.less\" \"#{file}.css\"")</string>
<key>input</key>
<string>document</string>
<key>name</key>
<string>Save to minified CSS</string>
<key>output</key>
<string>showAsTooltip</string>
<key>scope</key>
<string>source.css.less</string>
<key>uuid</key>
<string>448D3A8D-260E-4949-BA33-654886ECDCAF</string>
</dict>
</plist>
38 changes: 38 additions & 0 deletions DragCommands/Insert inline Image.tmDragCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env php
&lt;?php
$path = getenv('TM_DROPPED_FILE');
$path_parts = pathinfo($path);
$info = getimagesize($path);
list($width, $height) = $info;
$mime = $info['mime'];
$contents = base64_encode(file_get_contents($path));

echo "@gfx-{$path_parts['filename']}: \"data:{$mime};base64,{$contents}\";\n";
echo "@gfx-{$path_parts['filename']}-width: {$width}px;\n";
echo "@gfx-{$path_parts['filename']}-height: {$height}px;";</string>
<key>draggedFileExtensions</key>
<array>
<string>png</string>
<string>jpeg</string>
<string>jpg</string>
<string>gif</string>
</array>
<key>input</key>
<string>selection</string>
<key>name</key>
<string>Insert inline Image</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>source.css.less</string>
<key>uuid</key>
<string>7B0CA307-CC1C-4EE2-9F63-4825800ACDA7</string>
</dict>
</plist>