Import - Xcode extension for adding imports from anywhere in the code ☝️

Overview

Import ☝️

Xcode extension for adding imports from anywhere in the code.

Now available on App Store

usage.gif

Why?

Because sometimes you are on 300th line of code and scrolling up just to add an import is a waste of time. This was built to replace Peckham, as  decided to drop support for Xcode plugins in Xcode 8.

Installation Guide (Xcode 8 / OSX 10.11+)

OR

  • close Xcode
  • (OSX 10.11 only) sudo /usr/libexec/xpccachectl
  • download the Import app
  • unzip and copy to Applications folder
  • run (right click + open)
  • (optional) click on Install Key Bindings to install ⌘ + ctrl + P binding
  •  -> System Preferences... -> Extensions -> All -> Enable Import
  • open Xcode
  • select a source file
  • check if Editor -> Import -> ☝️ is there
  • WIN

Usage

Import uses Xcode's autocomplete, this works best when written inside a function / a method

  • type: import MODULE_NAME (#import "HEADER_NAME.h" in Obj-C) as you normally would
  • press ⌘ + ctrl + P or alternatively Editor -> Import -> ☝️

Supported languages

  • Swift
  • Objective-C
  • C++
  • C

License

MIT, see LICENSE.

Privacy

This app doesn't collect any of your data.

Comments
  • Import is not present in Extensions and doesn't seem to be installed

    Import is not present in Extensions and doesn't seem to be installed

    I'm on 10.11 and when I followed the steps in the readme I can't see it in Editor > Import. I can't see it in System Preferences > Extensions > All as well. When I click Install Key Bindings I get: Binding is already set. Import is ready to be used in Xcode.

    But I can not see it under Editor. What might be causing this, how can I help debug?

    opened by akaralar 17
  • Crash when pressing Install Key Bindings

    Crash when pressing Install Key Bindings

    I tried installing it on macOS 10.12 (16A323) with Xcode 8.0 (8A218a) and every time I pressed Install Key Bindings the Import.app was crashing.

    For some reason, changing the order of the following steps fixed it for me:

    • (optional) click on Install Key Bindings to install ⌘ + ctrl + P binding
    •  -> System Preferences... -> Extensions -> All -> Enable Import

    I had to:

    •  -> System Preferences... -> Extensions -> All -> Enable Import
    • (optional) click on Install Key Bindings to install ⌘ + ctrl + P binding

    instead.

    Any reason why this could be happening?

    Other than that, this extension is awesome!

    opened by Eddpt 14
  • Error: When triggering the shortcut and moving the import to the top, also the editor scroll up now

    Error: When triggering the shortcut and moving the import to the top, also the editor scroll up now

    Since the latest Xcode version it seems like that the editor scroll all the way to the top when entering a new include which makes this plugin quite unusable since you can't keep your focus at the current line.

    Is there a cure for this?

    opened by ForestRingGames 7
  • Weird Xcode crash after reimporting

    Weird Xcode crash after reimporting

    I was able to reproduce this more times but it could be a problem with my Xcode? (which is Version 8.0, 8A218a) To reproduce:

    1. Import something with CTRL + CMD + P
    2. Undo that with CMD + Z
    3. Import that again

    import_bug

    opened by nemesis 7
  • Installed in Xcode but does not do open the popup

    Installed in Xcode but does not do open the popup

    I've got it installed in Xcode Version 8.0 (8A218a) and Mac OS 10.12 (16A323) and it shows under Editor -> Import. If I press the hot key or click on it via them menu, nothing at all happens.

    When pressing the hotkey the top bar flashes....so it definitely triggers the "Import Extension", but the Import extension does not do a thing.

    How to fix this?

    opened by ForestRingGames 5
  • Migrated project Settings

    Migrated project Settings

    Hey,

    I’ve updated the project to use the latest project settings.

    Since Import is currently not working, if I recall, Apple recommended a few years ago that extension developers had to rebuild their Xcode extensions to have it work with Xcode 11/12 and later.

    This should solve #36

    opened by clementpadovani 1
  • Forward class regex catches array definitions

    Forward class regex catches array definitions

    When code contains class types in an array, the regex fails to ignore them and places the import below them.

    Example: [Fabric with:@[[Crashlytics class]]];

    Expected: the import is placed below other imports.

    Actual: the import is placed below the example line of code.

    [Fabric with:@[[Crashlytics class]]];
    #import "ABC.h"
    
    opened by markohlebar 0
  • Double imports

    Double imports

    This is an edge-case, but should be handled.

    You can import twice a file/module, this doesn’t result in a compilation issue, but a simple check wouldn’t hurt.

    opened by clementpadovani 0
  • You don’t have permission to save the file “KeyBindings” in the folder “UserData”.

    You don’t have permission to save the file “KeyBindings” in the folder “UserData”.

    Ye. I read your source code and test the function of add KeyBinding, but got this problem. Any other step I should do so that I can modify KeyBindings file?

    opened by LuoXin-s 2
  • Is this working with Xcode 10.1?

    Is this working with Xcode 10.1?

    Please let me know if this is still working with Xcode 10.1 or will be working with coming versions. And if yes please mention the proper way to integrate

    opened by HadiYaac 2
  • can not see the Extension

    can not see the Extension

    I can't see "Import" in System Preferences... -> Extensions -> All, but I binding success Environment:Xcode 9.2 (9C40b) + OS X 10.13.2

    image

    image

    image

    opened by HolmesZhao 0
  • Failing to import if part of the import matches.

    Failing to import if part of the import matches.

    Given there is an import already in the source file #import "TMKObject.h"

    When I add the import like so and cmd+ctrl+p #import "TMKObjectEquality.h"

    Expected: The import is added to the import list.

    #import "TMKObject.h"
    #import "TMKObjectEquality.h"
    

    Actual: The import is not added to the import list with a message "The import has already been included"

    opened by markohlebar 3
  • Sort the import line alphabetically

    Sort the import line alphabetically

    It would be nice if the plugin could insert the new import ... alphabetically. For example we have current import lines:

    import CoreGraphics import Foundation import UIKit

    if we're to add a new import line like import CoreLocation, it would be like this:

    import CoreGraphics import CoreLocation import Foundation import UIKit

    opened by harysutanto 1
Releases(1.0.7)
Owner
Marko Hlebar
iOS / macOS developer, working on trailerapp.io
Marko Hlebar
XTextHandler - Xcode Source Editor Extension Tools (Xcode 8 Plugins)

Download Let's Swift! xTextHandler has been rewritten in Swift. The Objective-C version can be found in: https://github.com/cyanzhong/xTextHandler-obj

Ying Zhong (Inactive) 1.5k Sep 7, 2022
SwiftInitializerGenerator - Xcode Source Code Extension to Generate Swift Initializers

Swift Initializer Generator This Xcode Source Code Extension will generate a Swift initializer based on the lines you've selected. Handy if you made a

Bouke Haarsma 718 Aug 21, 2022
XcodeEquatableGenerator - Xcode 8 Source Code Extension will generate conformance to Swift Equatable protocol based on type and fields selection.

Depricated! There is not need for it at the moment as Swift compiler can do that for us ?? Swift Equatable Generator Xcode 8 Source Code Extension wil

null 191 Dec 10, 2022
XShared - Xcode extension that allows you copying the code with special formatting quotes for social (Slack, Telegram)

This extension is for those who like to show code to the public ?? Xcode extension which allows you copying the code with special formatting quotes fo

Nikita Ermolenko 75 Jun 18, 2022
Xgist - Xcode extension to send code to GitHub's Gist

Xgist Xgist is a Xcode extension to send code to GitHub's Gist. The extension will send your code selection to Gist and automatically copy the Gist UR

Fernando Bunn 76 Jul 2, 2022
Comment-Spell-Checker - Xcode extension for spell checking and auto-correcting code comments.

Comment Spell Checker An Xcode Source Editor extension that runs spell check and auto correct on your code comments. Features Supports mutliple commen

Velislava Yanchina 157 Aug 28, 2022
CleanClosureXcode - An Xcode Source Editor extension to clean the closure syntax.

Clean Closure - Xcode Source Editor Extension Clean Closure is a simple Xcode Source Editor Extension for Xcode 8. It parses each line of a file to si

Patrick Balestra 188 Jun 18, 2022
Mark - Xcode extension for generating MARK comments.

Mark Xcode extension for automatic generation of MARK comments. Why? If you would like to organize your code with MARK comments, this will save you so

Velislava Yanchina 160 Dec 17, 2022
DocumenterXcode - Attempt to give a new life for VVDocumenter-Xcode as source editor extension.

DocumenterXcode Xcode source editor extension which helps you write documentation comment easier, for both Objective-C and Swift. This project is an a

Serhii Londar 34 Dec 17, 2022
Nef-plugin - 🔌 an Xcode extension to use nef features easily

This project provides an extension for Xcode to integrate some nef features directly in the IDE. Using the core of nef, you can export snippets from y

Bow 188 Dec 23, 2022
Multiliner - An Xcode source extension to expand lengthy lines

Multiliner An Xcode source extension to expand lengthy lines. Super lightweight, 1 file. It expands long lines. That's it! Works with: Initializers Fu

Andrew Zheng 629 Jan 4, 2023
This Xcode plugin shows Xcode app version in the Dock and App Switcher icon

Xcode Icon Version Tired of this Xcode icon always showing multiple times in your App Switch with no help watshoever as to which version you are curre

Stanislas Chevallier 94 Sep 11, 2022
Xcode plugin which help you write code faster.

MLAutoReplace Xcode plugin, Re-Intent, make you write code more quickly. Use a portion code of VVDocumenter-Xcode. ##Overview You can use shortcut key

molon 233 Sep 9, 2022
XVim2 - Vim key-bindings for Xcode 9

XVim2 XVim2 is a Vim plugin for Xcode intending to offer a compelling Vim experience without the need to give up any Xcode features. Xcode 9 or above,

null 2.3k Jan 1, 2023
Xcode plugin to let you jump to GitHub History, Blame, PRs, Issues, Notifications of any GitHub repo with one shortcut.

Reveal-In-GitHub Xcode plugin to let you jump to GitHub History, Blame, PRs, Issues, Notifications of current repo in one second. My company work on G

lzwjava 257 May 17, 2022
Plugin for Xcode to integrate the Reveal App to your project automatic.

Reveal-Plugin-for-Xcode Plugin for Xcode to integrate the Reveal App to your project automatic(Without any modifications to your project). Please note

Eric 229 Jun 29, 2022
A Xcode Source Editor Extension to sort your header imports and remove duplicates, similar to iSort.

CleanHeaders An Xcode plug-in to format your import headers in a systematic manner. It simply removes duplicates, spaces and sorts them alphabetically

Karthikeya Udupa 93 Oct 9, 2021
How to use swiftlint to identify unused code or unused imports in a Swift codebase

Swift compilation database This repository demonstrates how to use swiftlint to identify unused code or unused imports in a Swift codebase. How to run

Andrés Cecilia Luque 3 Aug 26, 2022
Companion app and XCode extension for adding SwiftUI recipes to your code.

SwiftUI Recipes Companion Free Companion app and XCode extension for adding SwiftUI recipes to your code. Choose from a rich selection of SwiftUI reci

Gordan Glavaš 17 Nov 20, 2022
YiVideoEditor is a library for rotating, cropping, adding layers (watermark) and as well as adding audio (music) to the videos.

YiVideoEditor YiVideoEditor is a library for rotating, cropping, adding layers (watermark) and as well as adding audio (music) to the videos. YiVideoE

coderyi 97 Dec 14, 2022