Skip to content

Instantly share code, notes, and snippets.

@saltnlight5
Created September 27, 2012 00:47
Show Gist options
  • Save saltnlight5/3791524 to your computer and use it in GitHub Desktop.
Save saltnlight5/3791524 to your computer and use it in GitHub Desktop.
Sublime Text 2
// A build script to run shell script in Windows using cygwin.
// NOTE that a selector is "source.shell", not ".sh"!
{
"cmd": ["C:/cygwin/bin/bash.exe", "--login", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.shell"
}
// Groovy build script.
{
"cmd": ["groovy", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.groovy",
"windows":
{
"cmd": ["C:/apps/groovy-2.0.1/bin/groovy.bat", "$file"]
},
// NOTE: We can't use env in the cmd path?
"osx":
{
"cmd": ["/Users/zemian/apps/groovy/bin/groovy", "$file"],
"env": {
"JAVA_HOME": "$HOME/apps/jdk"
}
}
}
{
"cmd": ["C:\\apps\\nailgun-0.7.1\\ng.exe", "groovy.ui.GroovyMain", "$file"]
}
/*
// Add key mapping in Default.sublime-keymap file
[
{ "keys": ["f5"], "command": "new_note_file" }
]
*/
import sublime, sublime_plugin
import time, os.path
class NewNoteFile(sublime_plugin.WindowCommand):
def run(self):
ttamp = time.strftime('%Y%m%d-%H%M%S', time.localtime())
v = self.window.new_file()
v.settings().set('default_dir', os.path.expanduser('~/notes'))
v.set_syntax_file('Packages/Markdown/Markdown.tmLanguage')
v.set_name(ttamp + '.md')
<snippet>
<content><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="${1:myBean}" class="${2:MyBean}">
<property name="${3:prop}" value="${4:testValue}"/>
</bean>
</beans>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>springxml</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.xml</scope> -->
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment