Coder Social home page Coder Social logo

dinneo / xtexthandler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from princemei/xtexthandler

0.0 3.0 0.0 2.49 MB

Xcode Source Editor Extension Tools (Xcode 8 Plugins)

Home Page: https://itunes.apple.com/app/id1163761963

License: MIT License

Swift 82.83% Objective-C 0.27% CSS 0.18% JavaScript 16.73%

xtexthandler's Introduction

Download

Let's Swift!

Language License

xTextHandler has been rewritten in Swift. The Objective-C version can be found in: https://github.com/cyanzhong/xTextHandler-objc

πŸ‡¨πŸ‡³δΈ­ζ–‡δ»‹η»

xTextHandler

Xcode Source Editor Extension Tools (Xcode 8 Plugins)

What is it

Xcode Source Editor Extension based tools to improve the text editing experience of Xcode 8 and provide extensions with simple code.

Features

  • Multiline Selections
  • Multiple Extensions
  • Extendable (Example: Dotify)
  • Swift 3.0
  • Clipboard Text Handling (if no selection is made)
  • Regular Expression Matching
  • Error handling
  • Preferences panel
  • JavaScript for text handling

Install from Mac App Store

  1. Clear DrivedData if you built xTextHandler before
  2. Install from: https://itunes.apple.com/app/id1163761963
  3. Open Xcode and select text
  4. Open Editor menu to find extensions
  5. You can set a shortcut (Key-Binding) for each extension
  6. If you got nothing after installed, it must be a bug of XcodeKit, you can try build this project

Setup if there's nothing on the Editor menu

image image

Build

  1. Install Xcode 8
  2. sudo /usr/libexec/xpccachectl in macOS EI Capitan
  3. Sign every targets (app & extensions) using your developer certificate
  4. Build & Run
  5. Choose Xcode 8 to debug (Or restart Xcode)
  6. Select text
  7. Open Editor menu to find extensions
  8. You can set a shortcut (Key-Binding) for each extension

xEncode

image

  • Base64 Encode
  • Base64 Decode
  • URL Encode
  • URL Decode
  • Upper Case
  • Lower Case
  • Escape
  • MD5
  • SHA1
  • SHA256
  • QR Code

xRadix

image

  • Hex
  • Bin
  • Oct
  • Dec

xColor

image

  • Hex
  • RGB
  • Preview

xSearch

image

  • Google
  • Translate
  • Developer
  • StackOverflow
  • GitHub
  • Dash
  • Dictionary

xFormat

image

  • JSON
  • XML
  • CSS
  • SQL

Thanks to: vkBeautify

How to write a new Extension

Add definition in Plist:

<dict>
    <key>XCSourceEditorCommandClassName</key>
    <string>aClassName</string>
    <key>XCSourceEditorCommandIdentifier</key>
    <string>test.extension</string>
    <key>XCSourceEditorCommandName</key>
    <string>Test Extension</string>
</dict>

Map handler via commandIdentifier in class:

// Implement your modify strategy using block (you can implement as singleton dict)
// [ "commandIdentifier": handler ]
override func handlers() -> Dictionary<String, xTextModifyHandler> {
    return [
        "test.extension": { text: String -> String in text }
    ]
}

* Handle with regex:

// Override performCommandWithInvocation like that
override func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: (NSError?) -> Void) {
    if let handler = self.handlers()[invocation.commandIdentifier] {
        xTextModifier.select(invocation: invocation, pattern: "regex", handler: handler)
    }
    completionHandler(nil)
}

Contacts

Weibo Twitter Email

xtexthandler's People

Contributors

cyanzhong avatar ianrahman avatar

Watchers

 avatar  avatar  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.