Skip to content

Commit

Permalink
Added some useful commands. In order to use 'Documentation for Word' …
Browse files Browse the repository at this point in the history
…ones you need to compile Support/lib/assistant_search helper first (simple "qmake && make" would do), then run Qt Assistant to generate help index.

git-svn-id: http://svn.textmate.org/trunk/Bundles/Qt.tmbundle@5409 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information
mblsha committed Oct 9, 2006
1 parent ba9e196 commit 378f818
Show file tree
Hide file tree
Showing 28 changed files with 1,968 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Commands/Build & Run.tmCommand
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>#!/bin/sh
"${TM_BUNDLE_SUPPORT}/bin/build_qt_project.rb" &amp;&amp; "${TM_BUNDLE_SUPPORT}/bin/run_qt_project.rb"</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>@R</string>
<key>name</key>
<string>Build &amp; Run</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
<string>source.c++.qt, source.qt-project</string>
<key>uuid</key>
<string>22F431D0-0CB5-4CAB-951F-8C0E7396891F</string>
</dict>
</plist>
22 changes: 22 additions & 0 deletions Commands/Build.tmCommand
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>"${TM_BUNDLE_SUPPORT}/bin/build_qt_project.rb"</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>@b</string>
<key>name</key>
<string>Build</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
<string>source.c++.qt, source.qt-project</string>
<key>uuid</key>
<string>AAAD64D1-8C69-4645-853E-B6DD3D04AC67</string>
</dict>
</plist>
22 changes: 22 additions & 0 deletions Commands/Class Declaration with Doxygen.tmCommand
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>${TM_RUBY:-ruby} "$TM_BUNDLE_SUPPORT/bin/insert_class.rb" doxygen</string>
<key>input</key>
<string>none</string>
<key>name</key>
<string>Class (with Doxygen)</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>source.c++.qt</string>
<key>tabTrigger</key>
<string>qclassdoxy</string>
<key>uuid</key>
<string>BFD08AAF-3AB2-4C55-9A57-2EB75ECD9CD1</string>
</dict>
</plist>
22 changes: 22 additions & 0 deletions Commands/Class Declaration.tmCommand
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>${TM_RUBY:-ruby} "$TM_BUNDLE_SUPPORT/bin/insert_class.rb"</string>
<key>input</key>
<string>none</string>
<key>name</key>
<string>Class</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>source.c++.qt</string>
<key>tabTrigger</key>
<string>qclass</string>
<key>uuid</key>
<string>1DB2A2E8-5E25-4442-9DE1-335E09854C9F</string>
</dict>
</plist>
34 changes: 34 additions & 0 deletions Commands/Declaration to Implementation (with Doxygen).tmCommand
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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># Converts method declarations to their
# out-of-class-declaration implementations
# with Doxygen placeholders in place.
#
# Could be applied to bunch of methods in
# selection.
#
# It's possible to override Doxygen placeholders
# after specifying name of the class.
${TM_RUBY:-ruby} "$TM_BUNDLE_SUPPORT/bin/declaration_to_implementation.rb" doxygen</string>
<key>fallbackInput</key>
<string>line</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>@u</string>
<key>name</key>
<string>Declaration to Implementation (with Doxygen)</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>source.c++, source.objc++, source.c, source.objc</string>
<key>uuid</key>
<string>97D13B6C-9CC2-4CAD-8CD3-80DC9CBC1968</string>
</dict>
</plist>
30 changes: 30 additions & 0 deletions Commands/Declaration to Implementation.tmCommand
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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># Converts method declarations to their
# out-of-class-declaration implementations.
#
# Could be applied to bunch of methods in
# selection.
${TM_RUBY:-ruby} "$TM_BUNDLE_SUPPORT/bin/declaration_to_implementation.rb"</string>
<key>fallbackInput</key>
<string>line</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>@u</string>
<key>name</key>
<string>Declaration to Implementation</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>source.c++, source.objc++, source.c, source.objc</string>
<key>uuid</key>
<string>C4517F03-DB1A-434E-BF29-F13DA337B20F</string>
</dict>
</plist>
24 changes: 24 additions & 0 deletions Commands/Display Documentation.tmCommand
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>${TM_RUBY:-ruby} "$TM_BUNDLE_SUPPORT/bin/search.rb" input</string>
<key>fallbackInput</key>
<string>word</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>^@h</string>
<key>name</key>
<string>Display Documentation</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
<string>source.c++.qt</string>
<key>uuid</key>
<string>D4885A64-9FF5-43BA-8D5E-AEB71E9E08C2</string>
</dict>
</plist>
24 changes: 24 additions & 0 deletions Commands/Display Fuzzy Documentation.tmCommand
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>${TM_RUBY:-ruby} "$TM_BUNDLE_SUPPORT/bin/search.rb" fuzzy input</string>
<key>fallbackInput</key>
<string>word</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>^~@h</string>
<key>name</key>
<string>Display Fuzzy Documentation</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
<string>source.c++.qt</string>
<key>uuid</key>
<string>F34F4BC0-C09C-4DAC-9B0C-EE7173964090</string>
</dict>
</plist>
29 changes: 29 additions & 0 deletions Commands/Documentation for Word : Selection (fuzzy).tmCommand
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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># Similiar to entering query in the Qt Assistant's
# "Look For:" field, then collecting topics for
# each displayed method, and then displaying an
# option to pick one of them using text box.
${TM_RUBY:-ruby} "$TM_BUNDLE_SUPPORT/bin/search.rb" fuzzy</string>
<key>fallbackInput</key>
<string>word</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>^~h</string>
<key>name</key>
<string>Fuzzy Documentation for Word / Selection</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
<string>source.c++.qt</string>
<key>uuid</key>
<string>C6BD2114-7620-4C35-A9B5-F44CA3291004</string>
</dict>
</plist>
29 changes: 29 additions & 0 deletions Commands/Documentation for Word : Selection.tmCommand
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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># Similiar to entering query in the Qt Assistant's
# "Look For:" field, and pressing enter. If
# there are multiple matches, there's an option
# to select one of them.
${TM_RUBY:-ruby} "$TM_BUNDLE_SUPPORT/bin/search.rb"</string>
<key>fallbackInput</key>
<string>word</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>^h</string>
<key>name</key>
<string>Documentation for Word / Selection</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
<string>source.c++.qt</string>
<key>uuid</key>
<string>DAD33E78-4FEF-43EB-A672-790E7140855A</string>
</dict>
</plist>
28 changes: 28 additions & 0 deletions Commands/Insert Call to Super.tmCommand
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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># Inserts a call to the same metod of superclass.
# Since figuring a superclass is a bit tricky, it
# only works when class declaration exists in the
# same file, and prior to the current line. If
# it's unable to find superclass, QWidget is used.
${TM_RUBY:-ruby} "$TM_BUNDLE_SUPPORT/bin/insert_super.rb"</string>
<key>input</key>
<string>document</string>
<key>name</key>
<string>Insert Call to Super</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>source.c++.qt</string>
<key>tabTrigger</key>
<string>super</string>
<key>uuid</key>
<string>02131A74-BB30-4A92-B8D0-BDD96FF9CD88</string>
</dict>
</plist>
33 changes: 33 additions & 0 deletions Commands/Reformat Block Comment.tmCommand
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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 ruby
# By Allan Odgaard:
# http://macromates.com/blog/archives/2006/04/12/customization-screencast/
txt = STDIN.read.gsub(%r{\A/|\*/\z}, '')
txt = txt.gsub(/^[ \t]*\*[ \t]*/, '')
txt = %x{ fmt &lt;&lt;&lt; '#{txt.gsub(/'/, "'\\\\''")}' }.chomp
txt = txt.gsub(/[$`\\]/, '\\\\\0')
txt = txt.sub(/(\n(?=\n))?(\n*)\z/, '\1$0\2')
print "/* " + txt.to_a.join(' * ') + " */"</string>
<key>fallbackInput</key>
<string>scope</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>^q</string>
<key>name</key>
<string>Reformat Block Comment</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>comment.block</string>
<key>uuid</key>
<string>68EA4D87-31FA-4492-9645-925128AB6C43</string>
</dict>
</plist>
22 changes: 22 additions & 0 deletions Commands/Run Application.tmCommand
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>"${TM_BUNDLE_SUPPORT}/bin/run_qt_project.rb"</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>@r</string>
<key>name</key>
<string>Run</string>
<key>output</key>
<string>showAsTooltip</string>
<key>scope</key>
<string>source.c++.qt, source.qt-project</string>
<key>uuid</key>
<string>97FDD49E-0E1B-4B68-9614-E57A5804C247</string>
</dict>
</plist>

0 comments on commit 378f818

Please sign in to comment.