Giter Club home page Giter Club logo

seesaw.sugar's Introduction

Seesaw.sugar

Seesaw.sugar provides on-demand balanced delimiter selecting for MacRabbit's Espresso text editor.

For instance, take this Javascript fragment:

function example(anArgument) {
    var customObject = {
        foo: 'bar',
        stuff: 'things'
    };
}

If you place your cursor next to the first { character and select Actions→Seesaw→Select Balanced Delimiters then the first { and last } characters will both be selected. Conversely, if you chose Jump To Balanced Delimiter instead, the last } character would be selected.

This allows you to very quickly see which delimiters are balanced against one another or to jump to the start or end of a block. If eligible characters are on both sides of your cursor, Seesaw will use the one immediately to the left.

Seesaw currently works with the following:

  • ( and )
  • [ and ]
  • { and }
  • < and >
  • HTML and XML tags
  • PHP delimiters (<?php and ?>)
  • Quotation marks around strings
  • Slashes delimiting Javascript regex literals
  • Comment delimiters around block comments

Lastly, if you place your cursor next to a delimiter character inside of a string, Seesaw will only look for closing delimiters in strings. For instance, take this nonsensical but illustrative code fragment:

var myJSONString = '{ "foo": "bar"';
if (foobarring) {
    myJSONString = myJSONString + ', "morefoo": "betterBar"';
    myJSONString += "}";
}

If you place your cursor next to the { character in the first string and choose Jump To Balanced Delimiter, the } character in the string on the fourth line will be selected.

Installation

Requires Espresso 2

The easiest way to install Seesaw.sugar currently is directly from GitHub:

cd ~/Library/Application\ Support/Espresso/Sugars
git clone git://github.com/onecrayon/Seesaw.sugar.git

Relaunch Espresso, and a new Seesaw submenu will be available in your Actions menu.

Alternately, you can download the project, decompress it, rename the resulting folder "Seesaw.sugar", and double click it to install.

Development

Seesaw.sugar is written entirely in XML and JavaScript using Espresso's JavaScript API! To discover how I'm doing things or tweak its behavior to fit your own needs, right click the Sugar in the Finder and choose Show Package Contents or fork this project and go to town.

You can also let me know if you have any feedback, requests, or run across any problems.

MIT License

Copyright (c) 2011 Ian Beck

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.

seesaw.sugar's People

Contributors

onecrayon avatar

Stargazers

Jeremy Reichman avatar  avatar Ola Christensson avatar Matt Lubner avatar Pete Schaffner avatar Quiz Chu avatar Jonathan Barratt avatar Tony Webster avatar org avatar Tom Davies avatar

Watchers

 avatar Pete Schaffner avatar James Cloos avatar Ola Christensson avatar Greg Perham avatar Emanuele Feliziani avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.