Skip to content

An Xcode plug-in to perform automatic pairing of message brackets.

Notifications You must be signed in to change notification settings

nanoant/TMXtras-for-Xcode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TextMate Xtras for Xcode

What is it?

This is a fork of excellent Ciarán Walsh's Xcode plug-in which makes writing Objective-C code easier, by automatically inserting paired message sending brackets.

Watch the screencast to see how it works.

What's new?

This fork adds Xcode 4 support and some extra features that makes Xcode editing feel more like TextMate:

  • Auto closing of brackets and quotes

    When you open a bracket or (double)quote, the plugin closes it for you and places the cursor (insertion point) between brackets (quotes).

  • Auto deletion of both brackets

    When the cursor (insertion point) is between empty brackets (quotes), pressing backspace (delete) removes them both.

  • ] always wraps

    Pressing ] when there is something selected, wraps the selection with square brackets, rather than replacing whole selection with ].

  • Whitespace display:

    This is well known TextMate feature I missed most in Xcode, now Xcode displays whitespaces (aka invisibles) with similar glyphs as TextMate using light-grey color.

  • Whitespace display

    This is well known TextMate feature I missed most in Xcode, now Xcode displays whitespaces (aka invisibles) with similar glyphs as TextMate using light-grey color.

Original functionality:

  • Wrap on ]

    When editing an Objective-C(++) or Objective-J file, you can type a ] to add a message to the current line. The plug-in will automatically look backwards to insert the opening bracket at the appropriate location.

Installation

  1. Open the project and build the plug-in.

  2. After a successful build the plug-in should automatically be installed; to install it manually move the product (AMSXcodeTMXtras.xcplugin) to ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins (create the directory if necessary).

  3. Restart Xcode.

Settings

All settings of this plugin are accessible via defaults. Restart should be not required normally when changing these defaults.

Values shown here are the default built-in values.

  • defaults write -app Xcode AMSSpaceGlyph "" (empty to hide)
  • defaults write -app Xcode AMSTabGlyph "\u254E" (empty to hide)
  • defaults write -app Xcode AMSReturnGlyph "\u00AC" (empty to hide)
  • defaults write -app Xcode AMSWhitespaceGray -float 0.6
  • defaults write -app Xcode AMSWhitespaceAlpha -float 0.25

Credits

  • Joachim Mårtensson

    The bracket placement logic (i.e. most of the hard work) was already done by Joachim Mårtensson for the Objective-C TextMate bundle, found here inside the parser.rb script.

License

This software is provided under MIT license:

Copyright (c) 2009 Ciarán Walsh, 2010-2014 Adam Strzelecki

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

An Xcode plug-in to perform automatic pairing of message brackets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 100.0%